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.
Revision 1:1e5f482dad5b, committed 2020-05-19
- Comitter:
- gr91
- Date:
- Tue May 19 20:00:04 2020 +0000
- Parent:
- 0:b4a900df72eb
- Commit message:
- Bloquant
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue May 19 18:08:29 2020 +0000 +++ b/main.cpp Tue May 19 20:00:04 2020 +0000 @@ -1,14 +1,22 @@ #include "mbed.h" -Timer temps; -Serial pc(SERIAL_TX, SERIAL_RX,9600); +DigitalOut ledR(PB_2); +DigitalOut ledG(PE_8); int main() { - unsigned int t0,t1; - temps.start(); - t0=temps.read_us(); - pc.printf("Hello World\r\n"); - t1=temps.read_us(); - pc.printf("duree mesuree : %d\r\n",t1-t0); - while(1); + unsigned short compteur1=0,compteur2=0; + ledR=0; + ledG=0; + while (true) { + wait_ms(1); + compteur1++; + compteur2++ ; + if(compteur1>500) { + ledR=!ledR; + compteur1=0 ; + } + if(compteur2>1500) { + ledG=!ledG; + compteur2=0 ; + } + } } -