Arduino_Button sample code ported.
Fork of InterruptIn_HelloWorld by
main.cpp
- Committer:
- homayoun
- Date:
- 2014-09-03
- Revision:
- 1:45300b60edf4
- Parent:
- 0:7a20a6aa1f5e
File content as of revision 1:45300b60edf4:
#include "mbed.h" DigitalIn button(USER_BUTTON); DigitalOut led(LED1); void setup() { button.mode(PullUp); } void loop() { if (button == 0) { // turn LED on: led = 1; } else { // turn LED off: led = 0; } } int main() { setup(); while(1) loop(); }