Anoney Potter
/
Nucleo_DigitalInput
Nucleo_DigitalInput
Diff: main.cpp
- Revision:
- 0:e66a2abcf59d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Dec 11 14:20:57 2015 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" + +DigitalOut Nucleo_GREEN_LED(LED1); +DigitalIn Push_Button(PC_13,PullNone); + +int main() +{ + while(1) + { + if(Push_Button.read() == 0) // pressed button + { + Nucleo_GREEN_LED = 1; // LED is ON + } + else + { + Nucleo_GREEN_LED = 0; // LED is OFF + } + } +}