britneybeatey

Scrolling and Photoresistor Value

Jun 21st, 2017
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. /*
  2. * Britney Beatey
  3. * 6/20/17
  4. * LCD Scrolling
  5. */
  6. #include <LiquidCrystal.h>
  7. LiquidCrystal lcd (12, 10, 2, 4, 7, 13);
  8.  
  9. const int photoPin = A1;
  10. int photoVal =0;
  11.  
  12. void setup() {
  13. // put your setup code here, to run once:
  14. pinMode (photoPin, INPUT);
  15. lcd.begin(16,2);
  16. lcd.clear();
  17. }
  18.  
  19. void loop()
  20. {
  21.  
  22. photoVal = analogRead(photoPin);
  23. lcd.print("the value is: ");
  24. lcd.setCursor(6,1);
  25. lcd.print (photoVal);
  26. delay(100);
  27. lcd.clear();
  28.  
  29. // put your main code here, to run repeatedly:
  30. //for(int counter = 0; counter < 12; counter++)
  31. //{
  32. // lcd.setCursor (counter, 0);
  33. // lcd.print("Britney");
  34. // delay(300);
  35. // lcd.clear();
  36. //}
  37. }
Add Comment
Please, Sign In to add comment