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