//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <LiquidCrystal_I2C.h>
#define LDR_PIN_E 2
#define LDR_PIN_W 3
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup()
{
lcd.init(); // initialize the lcd
// Print a message to the LCD.
lcd.backlight();
}
void loop() {
lcd.setCursor(1, 0);
lcd.print("Move: ");
if ((digitalRead(LDR_PIN_E) == HIGH) && (digitalRead(LDR_PIN_W) == HIGH)) {
lcd.print("Night. Reset"); // insert code to move servo west
} else if ((digitalRead(LDR_PIN_E) == HIGH) && (digitalRead(LDR_PIN_W) == LOW)){
lcd.print(" west"); // move servo X steps advancing west
} else {
lcd.print("Sunshine!");
}
delay (100);
}