Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Repo_Noeud_Mobile by
CountDown/CountDown.cpp
- Committer:
- llarose
- Date:
- 2015-03-05
- Revision:
- 3:a77d02cb5694
- Parent:
- 1:601d2922ff06
- Child:
- 17:1a634bb615f3
File content as of revision 3:a77d02cb5694:
#include "CountDown.h" Serial pc(USBTX, USBRX); CountDown::CountDown(int time) // initialisation list : t(time>>2) /// division par 4 pour temps entre ch. LED. { //pc.printf("constructor time %i \r\n", t); led[0] = new DigitalOut(LED1); led[1] = new DigitalOut(LED2); led[2] = new DigitalOut(LED3); led[3] = new DigitalOut(LED4); } CountDown::~CountDown() { for(int i(0); i<NBRE_LED; i++){ delete led[i]; } } bool CountDown::run() { int j(NBRE_LED); for(int i(0); i<j ; i++){ // ALL ON. led[i]->write(1); } while(j) // Actual CountDown. { j--; pc.printf("run\r\n"); Thread::wait(t); pc.printf("after wait \r\n"); led[j]->write(0); } for(int u(0); u < NBRE_LED; u++) // Flashing State { Thread::wait(100); for(int i(0); i<NBRE_LED ; i++){ led[i]->write(u%2); } } return true; }