Daniel Vizcaya
/
Btn_LED
boton led
main.cpp@0:980e873c678f, 2018-05-30 (annotated)
- Committer:
- Bethory
- Date:
- Wed May 30 00:06:07 2018 +0000
- Revision:
- 0:980e873c678f
boton led
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Bethory | 0:980e873c678f | 1 | #include "mbed.h" |
Bethory | 0:980e873c678f | 2 | |
Bethory | 0:980e873c678f | 3 | DigitalIn button(PC_13); // Change to match your board |
Bethory | 0:980e873c678f | 4 | DigitalOut led(PA_5); |
Bethory | 0:980e873c678f | 5 | |
Bethory | 0:980e873c678f | 6 | #define button_press 0 |
Bethory | 0:980e873c678f | 7 | |
Bethory | 0:980e873c678f | 8 | int main() { |
Bethory | 0:980e873c678f | 9 | while(1) { |
Bethory | 0:980e873c678f | 10 | if(button_press == button){ |
Bethory | 0:980e873c678f | 11 | led = !led; |
Bethory | 0:980e873c678f | 12 | wait(1); |
Bethory | 0:980e873c678f | 13 | } |
Bethory | 0:980e873c678f | 14 | } |
Bethory | 0:980e873c678f | 15 | } |