Valentin Ivanov
/
mBuino_Dice
Electornic dice application for mBuino platform
main.cpp
- Committer:
- Architect
- Date:
- 2014-07-23
- Revision:
- 0:5d9ccbe9d49d
File content as of revision 0:5d9ccbe9d49d:
#include "mbed.h" //#include "rtos.h" float delayTime = .05; DigitalOut LED[] = {(P0_7), (P0_8), (P0_2), (P0_20), (P1_19), (P0_17), (P0_23)};// declare 7 LEDs int main() { int i = 0; while( i < 10 ) { for(int x = 0; x < 7; x++) { LED[x] = 1; // turn on wait(delayTime); // delay } for(int x = 0; x < 7; x++) { LED[x] = 0; // turn off wait(delayTime); // delay } for(int x = 6; x >= 0; x--) { LED[x] = 1; // turn on wait(delayTime); // delay } for(int x = 6; x >= 0; x--) { LED[x] = 0; // turn off wait(delayTime); // delay } i++; } //Thread::wait(osWaitForever); }