int ledPin1 = 9; //LED (left eye)connected to pin 9 int ledPin2 = 6; //LED (right eye) connected to pin 6 int lightSensorPin = A4; //Light sensor connected to analog pin 4 int sensorValue; //Variable to store the value coming from the light sensor int lightpos = A5; //Positive petal of light sensor connected to A5 int ground1 = 10; //This will be the negative line for the left eye int ground2 = 5; //This will be the negative line for the right eye void setup() { pinMode(ledPin1, OUTPUT); //Sets ledPin to be an output pinMode(ledPin2, OUTPUT); //Sets ledPin to be an output pinMode(lightpos, OUTPUT);//Sets sensor pin to be an output digitalWrite(lightpos, HIGH); //gives power to the light sensor pinMode(ground1, OUTPUT); digitalWrite(ground1, LOW); //Turns off power to pin 5 (ground1) pinMode(ground2, OUTPUT); digitalWrite(ground2, LOW); //Turns off power to pin 10 (ground2) } void loop() { sensorValue = analogRead(lightSensorPin); if(analogRead(lightSensorPin) < 30) { //if it is dark, the LED lights will turn on digitalWrite(ledPin1, HIGH); digitalWrite(ledPin2, HIGH); } else //it it is light, the LED lights will stay off digitalWrite(ledPin1, LOW); digitalWrite(ledPin2, LOW); } /*Lilypad Arduino Nightime Owl Pillow Created by Jenny Parks January 2015 Special thanks to Casey Rawson. Much of my code was guided by her Night and Day Toy Code */