![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Exo
Diff: main.cpp
- Revision:
- 17:9e3454009d20
diff -r c4bfe797dfaf -r 9e3454009d20 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue May 29 14:13:27 2018 +0000 @@ -0,0 +1,85 @@ +#include "Nboard.h" +#include "IHM.h" +IHM ihm; + +int main() +{ + float n= 0.1; + int motif=1,sar=0; + int position; + while(1) { + while(motif<0x200) { + motif=motif<<1; + ihm.BAR_set(motif); + position = ihm.JOG_read(); + if(position==0x04) { + while(position==0x04){} + ihm.LCD_gotoxy(0,0); + ihm.LCD_printf("pause "); + sar=1; + } + while(sar==1){ + if (position==0x04) { + while(position==0x04){} + ihm.LCD_gotoxy(0,0); + ihm.LCD_printf("play "); + sar=0;}} + + wait(n); + } + + while(motif>0x1) { + motif=motif>>1; + ihm.BAR_set(motif); + position = ihm.JOG_read(); + if(position==0x04) { + while(position==0x04){} + ihm.LCD_gotoxy(0,0); + ihm.LCD_printf("pause "); + sar=1; + } + while(sar==1){ + if (position==0x04) { + while(position==0x04){} + ihm.LCD_gotoxy(0,0); + ihm.LCD_printf("play "); + sar=0;}} + + wait(n); + } +} +} + /* ihm.LCD_gotoxy(0,0); + switch(position) { + case 0x08 : + n=n+0.1; + ihm.LCD_printf("HA%f ",n); + break; + case 0x01 : + n=n-0.1; + ihm.LCD_printf("B%f ",n); + break; + case 0x10 : + ihm.LCD_printf("DROITE "); + break; + case 0x02 : + ihm.LCD_printf("GAUCHE "); + break; + case 0x18 : + ihm.LCD_printf("HAUT DROITE"); + break; + case 0x0A : + ihm.LCD_printf("HAUT GAUCHE"); + break; + case 0x03 : + ihm.LCD_printf("BAS GAUCHE "); + break; + case 0x11 : + ihm.LCD_printf("BAS DROITE "); + break; + + } + + } +} +*/