Maurizio Conti
/
accell-FRDMKL25
Using on board MMA8451Q on FRK25
main.cpp
- Committer:
- emilmont
- Date:
- 2012-10-23
- Revision:
- 3:c9a411d4fe64
- Parent:
- 2:b085bc47e75b
- Child:
- 6:71e35394bb3e
File content as of revision 3:c9a411d4fe64:
#include "mbed.h" Ticker tick; DigitalOut led1(LED_RED); DigitalOut led2(LED_GREEN); void flip() { led2 = !led2; } int main() { tick.attach(&flip, 0.7); // setup ticker to call flip led2 after 0.7 seconds // spin in a main loop. while (true) { led1 = !led1; wait (0.3); // flip led1 every 0.3 seconds } }