Horloge RTC

Dependencies:   ihm_L476_full RTC_IUT

Committer:
gr91
Date:
Tue May 19 20:00:04 2020 +0000
Revision:
1:1e5f482dad5b
Parent:
0:b4a900df72eb
Child:
2:29559ef1623d
Bloquant

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gr91 0:b4a900df72eb 1 #include "mbed.h"
gr91 1:1e5f482dad5b 2 DigitalOut ledR(PB_2);
gr91 1:1e5f482dad5b 3 DigitalOut ledG(PE_8);
gr91 0:b4a900df72eb 4 int main()
gr91 0:b4a900df72eb 5 {
gr91 1:1e5f482dad5b 6 unsigned short compteur1=0,compteur2=0;
gr91 1:1e5f482dad5b 7 ledR=0;
gr91 1:1e5f482dad5b 8 ledG=0;
gr91 1:1e5f482dad5b 9 while (true) {
gr91 1:1e5f482dad5b 10 wait_ms(1);
gr91 1:1e5f482dad5b 11 compteur1++;
gr91 1:1e5f482dad5b 12 compteur2++ ;
gr91 1:1e5f482dad5b 13 if(compteur1>500) {
gr91 1:1e5f482dad5b 14 ledR=!ledR;
gr91 1:1e5f482dad5b 15 compteur1=0 ;
gr91 1:1e5f482dad5b 16 }
gr91 1:1e5f482dad5b 17 if(compteur2>1500) {
gr91 1:1e5f482dad5b 18 ledG=!ledG;
gr91 1:1e5f482dad5b 19 compteur2=0 ;
gr91 1:1e5f482dad5b 20 }
gr91 1:1e5f482dad5b 21 }
gr91 0:b4a900df72eb 22 }