Hardware configuration for the led project

What must the hardware configuration for the led project be?

1 Like

In product configuring ,hardware select any one the 5 GPIO pins(0,1,2,3,4),resistor one end should be connected to that selected pin only and mention that pin in code also.

should i give a variable for data from that pin?
if yes, where should it be used in the code?

In hardware configuration of led project, we can connect ldr to either 5 digital pins or to analog pin (A0). If you connect digital pins, you can only see 0’s and 1’s in the table which is not clear whether the light intensity is increasing or decreasing. I recommend you to use analog pin, you can see analog values varying from 0 to 256 according to light intensity, which is helpful to see the graph of increasing or decreasing of light intensity with respect to time. Another end of LDR should be given to input voltage pin(3.3V). 1k ohm resistor should be given to the pin which is used for LDR which is series connection of resistors. Another end of resistor should be given to ground(GND).