Alberto Piganti
/
blip_buttons
miniblip button example
Diff: main.cpp
- Revision:
- 0:c743f6be0671
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Nov 26 09:26:11 2015 +0000 @@ -0,0 +1,23 @@ +// miniblip onboard buttons + +// main button: P0_23 +// progr button: P0_1 +// vibration/tilt: P1_15 +// external buttons: P0_15, P0_14, P0_13, P0_12, P0_11 +// encoder: P0_20, P0_2 +// encoder button: P1_19 +// ext (top/left): P0_21 + +#include "mbed.h" + +DigitalIn pushbutton(P0_23); //Define pushbutton +Serial pc(USBTX, USBRX); // Define serial TX RX + +int main() { + while(1) { + if (pushbutton) { + pc.printf("Hello World"); + wait(1); // Waits 1 second and print Hello World again + } + } +} \ No newline at end of file