![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Test 1
main.cpp
- Committer:
- benbrou06
- Date:
- 2019-11-26
- Revision:
- 0:671f83c726f2
File content as of revision 0:671f83c726f2:
//#define Passe_Temps1 #ifdef Passe_Temps1 #include "mbed.h" #include "info1.h" void Led(int); int main() { PwmOut led1( LED_RED ); PwmOut led2( LED_GREEN ); PwmOut led3( LED_BLUE ); led1.period_us(100); led2.period_us(100); led3.period_us(100); int val1,val2,etat=0,Allumer; led1 = 1; led2 = 1; led3 = 1; while (1) { appui_ana (&val1,&val2,0.5); if (val1==1) { Allumer=1; do { switch(etat) { case 0 : etat =1; break; case 1 : etat =2; break; case 2 : etat =3; break; case 3 : etat =4; break; case 4 : etat =5; break; case 5 : etat =6; break; case 6 : etat =0; break; } switch(etat) { case 0 : led1 = 1; led2 = 1; led3 = 1; break; case 1 : led1 = 1; led2 = 0; led3 = 1; break; case 2 : led1 = 0; led2 = 0; led3 = 1; break; case 3 : led1 = 1; led2 = 1; led3 = 0; break; case 4 : led1 = 1; led2 = 0; led3 = 0; break; case 5 : led1 = 0; led2 = 1; led3 = 1; break; case 6 : led1 = 0; led2 = 1; led3 = 0; break; } appui_ana (&val1,&val2,0.5); if (val2==1) {led1 = 1; led2 = 1; led3 = 1;Allumer=0;etat=0;} wait_ms(800); } while(Allumer==1); } } } #endif