![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
potention test program
main.cpp@0:ea5527eaa968, 2013-02-12 (annotated)
- Committer:
- mbed_official
- Date:
- Tue Feb 12 15:21:21 2013 +0000
- Revision:
- 0:ea5527eaa968
- Child:
- 1:29f7f8843c31
AnalogIn Hello World
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:ea5527eaa968 | 1 | #include "mbed.h" |
mbed_official | 0:ea5527eaa968 | 2 | |
mbed_official | 0:ea5527eaa968 | 3 | AnalogIn ain(p19); |
mbed_official | 0:ea5527eaa968 | 4 | DigitalOut led(LED1); |
mbed_official | 0:ea5527eaa968 | 5 | |
mbed_official | 0:ea5527eaa968 | 6 | int main() { |
mbed_official | 0:ea5527eaa968 | 7 | while (1){ |
mbed_official | 0:ea5527eaa968 | 8 | if(ain > 0.3) { |
mbed_official | 0:ea5527eaa968 | 9 | led = 1; |
mbed_official | 0:ea5527eaa968 | 10 | } else { |
mbed_official | 0:ea5527eaa968 | 11 | led = 0; |
mbed_official | 0:ea5527eaa968 | 12 | } |
mbed_official | 0:ea5527eaa968 | 13 | } |
mbed_official | 0:ea5527eaa968 | 14 | } |