britneybeatey

Testing Photoresistor

Jun 14th, 2017
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. /*
  2. * Britney Beatey
  3. * Testing Photoresistors
  4. *
  5. */
  6. const int photoPin = A0;
  7. int photoValue = 0;
  8. void setup()
  9. {
  10. Serial.begin(9600);
  11. pinMode (photoPin, INPUT);
  12.  
  13. }
  14.  
  15. void loop()
  16. {
  17. photoValue = analogRead (photoPin);
  18. Serial.print (" Photoresistor value = ");
  19. Serial.println (photoValue);
  20. }
Add Comment
Please, Sign In to add comment