![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Exo
Diff: main.cpp
- Revision:
- 0:eabaa36e66b0
diff -r 000000000000 -r eabaa36e66b0 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue May 29 14:14:42 2018 +0000 @@ -0,0 +1,42 @@ +#include "Nboard.h" +#include "IHM.h" + +IHM ihm; +PwmOut led1(PA_7); +int main() +{ + + int per=1000, position ; + float duty=0.25; + led1.period_ms(per); + led1.write(duty); + position =ihm.JOG_read(); + led0=1; + while(1) { + switch(position) { + case 0x08 : + if(duty<=0.9) { + duty=duty+0.1; + } + break; + case 0x01 : + if(duty>=0.1) { + duty=duty-0.1; + } + break; + case 0x10 : + per=per+500; + break; + case 0x02 : + per=per-500; + break; + + + + } + led1.period_ms(per); + led1.write(duty); + ihm.LCD_gotoxy(0,0); + ihm.LCD_printf("%f %hd ",duty,per); + } +}