top of page
Light Controlled LED Code

void setup() {
Serial.begin(9600);
//Begin in the serial monitor in to check light levels
}
void loop() {
int lightValue = analogRead(A0); 
//Read pin A0 to measure the signal returning from the light sensor
if (lightValue < 50) //If it gets darker that a value of 50
{
digitalWrite (8, HIGH); 
//Turn the light on
}
else
{
digitalWrite (8, LOW); 
//If it is not dark enough, leave the light off
}

delay (10);
 
}

Igniting Innovation through Functional Prototyping and Physical Computing

Contact Information

odysseyboardedu.@gmail.com
Phone: (360) 303-5526
24338 Lee Road
Mount Vernon, WA 98274

Contact Us

Thanks for submitting!

© 2017 by Odyssey Board. All rights reserved.

bottom of page