![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Street light control system banate h, onboard LED ko light jaise use karke. Isme sabse important part h ldr ka min, max, ambient rakhke thresholds nikalna.
Dependencies: HysteresisIn mbed
Diff: main.cpp
- Revision:
- 0:2821276434a8
diff -r 000000000000 -r 2821276434a8 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jul 01 09:25:42 2016 +0000 @@ -0,0 +1,13 @@ +#include "mbed.h" +#include "HysteresisIn.h" + +//analog pin, two thresholds and initial state +HysteresisIn ldr(PTB1, 0.2, 0.4, 0); +DigitalOut led(PTD1); + +int main() { + while(1) { + led = 1-ldr.read();//led.write(ldr.read()); //boolean value + } +} +