Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Manvi Mittal
- * LCD with photoresistor
- */
- #include <LiquidCrystal.h>
- LiquidCrystal lcd (10, 19, 11, 12, 13, 7);
- const int photoPin = A3;
- int photoVal = 0;
- void setup() {
- // put your setup code here, to run once:
- lcd.begin (16, 2);
- lcd.print ("My name is");
- lcd.setCursor (12, 0);
- lcd.print ("...");
- delay (1000);
- lcd.setCursor (4, 1); // if you do not set your cursor, it will start at 0, 0
- lcd.print ("Manvi");
- delay (3000);
- lcd.clear ();
- }
- void loop() {
- // put your main code here, to run repeatedly:
- photoVal = analogRead (photoPin);
- lcd.print ("The value is:");
- lcd.setCursor (6, 1);
- lcd.print (photoVal);
- delay (200);
- lcd.clear ();
- // for (int i = 0; i <= 11; i++)
- // {
- // lcd.setCursor (i, 0);
- // lcd.print ("Manvi");
- // delay (500);
- // lcd.clear ();
- // }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement