Tuesday, January 21, 2014

2nd week TH 1.16.14 Using a Light Dependent Resistor(LDR) White instead of push button

Inserted a Light Dependent Resistor(LDR) which changes the light for both LEDS based on amount of light.

Inserted four programming languages that will do the following:
Both LED lights are on.


 

As I lower the finger closer to the top of the LDR, I program one LED to turn off.

 

As I lower it more, the yellow LED turns on and the green LED turns off.


 

I place finger on top of LDR removing any light from being received by resistor.  No LED turns on.

turn off:  digitalWrite(ledPin, LOW);
turn on: digitalWrite(ledPin,HIGH);

No comments:

Post a Comment