Input device

An input device is a hardware or peripheral device used to send data to a microcontroller. An input device allows users to communicate and feed instructions and data to microcontroller for processing, display, storage and/or transmission.

I plan to use LDR(light dependent resistor) as my input devices.

Circuit Design and board

On Circuit board, i try to design circuit by using eagle software.

sensor(LDR)

In the broadest definition, a sensor is a device, module, or subsystem whose purpose is to detect events or changes in its environment and send the information to other electronics, frequently a computer processor.

LDR is a photoresistor is a light-controlled variable resistor. The resistance of a photoresistor decreases with increasing incident light intensity, in other words, it exhibits photoconductivity.

Programming

I try to program my board i was design.I use C programming language in arduino ide as editor and then i upload my code.

As i say on Embedded programming arduino it has two main parts which void setup where we can somethings which is input or output here also can write code which run once.and also there is void loop where we can write code which run continouly.

As weekly assignment call input devices my input is LDR(light dependentresistor) which use to sense light. Actually when there is dark LED it supposed to be ON if there is light LED go OFF.

The type of protocol i use in this code is I2C because i use analogRead.

That my code i try to write.

Testing

Here you can download all file on this week Download the files here