Prathamesh Satardekar
/
SampleTSI
Sample
main.cpp@0:1cd1fbb9a039, 2018-01-09 (annotated)
- Committer:
- prathameshrs22
- Date:
- Tue Jan 09 10:52:48 2018 +0000
- Revision:
- 0:1cd1fbb9a039
Initial;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
prathameshrs22 | 0:1cd1fbb9a039 | 1 | #include "mbed.h" |
prathameshrs22 | 0:1cd1fbb9a039 | 2 | #include "TSISensor.h" |
prathameshrs22 | 0:1cd1fbb9a039 | 3 | |
prathameshrs22 | 0:1cd1fbb9a039 | 4 | int main(void) { |
prathameshrs22 | 0:1cd1fbb9a039 | 5 | PwmOut led(LED_GREEN); |
prathameshrs22 | 0:1cd1fbb9a039 | 6 | TSISensor tsi; |
prathameshrs22 | 0:1cd1fbb9a039 | 7 | |
prathameshrs22 | 0:1cd1fbb9a039 | 8 | while (true) { |
prathameshrs22 | 0:1cd1fbb9a039 | 9 | led = 1.0 - tsi.readPercentage(); |
prathameshrs22 | 0:1cd1fbb9a039 | 10 | wait(0.1); |
prathameshrs22 | 0:1cd1fbb9a039 | 11 | } |
prathameshrs22 | 0:1cd1fbb9a039 | 12 | } |