miniblip button example

Dependencies:   mbed

main.cpp

Committer:
pighixxx
Date:
2015-11-26
Revision:
0:c743f6be0671

File content as of revision 0:c743f6be0671:

// 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    
        }
    }
}