Skip to content

Instantly share code, notes, and snippets.

@penpencool
Created August 5, 2018 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save penpencool/bb0442a6bc8becca97445f202385bab3 to your computer and use it in GitHub Desktop.
Save penpencool/bb0442a6bc8becca97445f202385bab3 to your computer and use it in GitHub Desktop.
/*
Example By ArduinoAll.com
OUT -> A0
VCC -> 3.3-5V
GND -> GND
*/
void setup() {
Serial.begin(9600);
pinMode(8, OUTPUT);
}
void loop() {
Serial.print("Light sensor value : ");
int val = analogRead(A0);
Serial.println(val);
delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment