![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Isme light band chalu hotai do setpoints ke aas paas, hysteris account me leke
Dependencies: HysteresisIn mbed
Fork of Hysteresis by
main.cpp@1:16341991cdfb, 2016-06-29 (annotated)
- Committer:
- akashlal
- Date:
- Wed Jun 29 06:38:55 2016 +0000
- Revision:
- 1:16341991cdfb
- Parent:
- 0:5913813b85d9
na
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
SIT2016 | 0:5913813b85d9 | 1 | #include "mbed.h" |
SIT2016 | 0:5913813b85d9 | 2 | #include "HysteresisIn.h" |
SIT2016 | 0:5913813b85d9 | 3 | |
SIT2016 | 0:5913813b85d9 | 4 | //analog pin, two thresholds and initial state |
akashlal | 1:16341991cdfb | 5 | HysteresisIn pot(PTB0, 0.3, 0.7, 0); |
akashlal | 1:16341991cdfb | 6 | DigitalOut led(PTD1); |
SIT2016 | 0:5913813b85d9 | 7 | |
SIT2016 | 0:5913813b85d9 | 8 | int main() { |
SIT2016 | 0:5913813b85d9 | 9 | while(1) { |
akashlal | 1:16341991cdfb | 10 | led.write(pot.read()); //boolean value |
SIT2016 | 0:5913813b85d9 | 11 | wait(1); |
SIT2016 | 0:5913813b85d9 | 12 | |
SIT2016 | 0:5913813b85d9 | 13 | } |
SIT2016 | 0:5913813b85d9 | 14 | } |
SIT2016 | 0:5913813b85d9 | 15 |