![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
darkness activated switch
main.cpp
- Committer:
- faif
- Date:
- 2015-03-15
- Revision:
- 1:8cf180275a19
- Parent:
- 0:aa10f42a839d
File content as of revision 1:8cf180275a19:
#include "mbed.h" #include "main.h" int main () { float ldr_value = 0; while (true) { ldr_value = myldr; if (ldr_value > THRES_OFF) { myled = LedOn; } if (ldr_value < THRES_ON) { myled = LedOff; } } }