Quentin LAM
/
ex17
Exo
main.cpp
- Committer:
- Quent1nl
- Date:
- 2018-05-29
- Revision:
- 17:9e3454009d20
File content as of revision 17:9e3454009d20:
#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; } } } */