#define LIGHT_PIN A0
#define LED_PIN 13
void setup() {
// put your setup code here, to run once:
pinMode(LIGHT_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int lightLevel = analogRead(LIGHT_PIN);
Serial.printIn
if(lightLevel > 900)
{
digitalWrite(LIGHT_PIN, HIGH);
}
else
{
digitalWrite(LIGHT_PIN, LOW);
}
}