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
Revision 0:2821276434a8, committed 2016-07-01
- Comitter:
- akashlal
- Date:
- Fri Jul 01 09:25:42 2016 +0000
- Commit message:
- na
Changed in this revision
diff -r 000000000000 -r 2821276434a8 HysteresisIn.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HysteresisIn.lib Fri Jul 01 09:25:42 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/kayekss/code/HysteresisIn/#fe43537bd3d6
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 + } +} +
diff -r 000000000000 -r 2821276434a8 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Jul 01 09:25:42 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34 \ No newline at end of file