Make UR Own

Monday, January 19, 2015

How to use a photoresistor to control on board LED or any device of your choice |Tiva C TM4C123GXL

Components:

Tiva C Launchpad
1 Photoresistor
1k Resistor


Circuit Diagram:





Code:

Note:
you can change the threshold value based on your photoresistor.
In case if you want to control some other device of choice,you can just change the following lines of code in the program

if (voltage>Threshold)
{

//Add the device control program

}

Download the file here  LedExampleDownload

If you need any help, feel free to contact me. Thank you.





No comments:

Post a Comment