Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "Nboard.h" 00002 #include "IHM.h" 00003 00004 IHM ihm; 00005 PwmOut led1(PA_7); 00006 int main() 00007 { 00008 00009 int per=1000, position ; 00010 float duty=0.25; 00011 led1.period_ms(per); 00012 led1.write(duty); 00013 position =ihm.JOG_read(); 00014 led0=1; 00015 while(1) { 00016 switch(position) { 00017 case 0x08 : 00018 if(duty<=0.9) { 00019 duty=duty+0.1; 00020 } 00021 break; 00022 case 0x01 : 00023 if(duty>=0.1) { 00024 duty=duty-0.1; 00025 } 00026 break; 00027 case 0x10 : 00028 per=per+500; 00029 break; 00030 case 0x02 : 00031 per=per-500; 00032 break; 00033 00034 00035 00036 } 00037 led1.period_ms(per); 00038 led1.write(duty); 00039 ihm.LCD_gotoxy(0,0); 00040 ihm.LCD_printf("%f %hd ",duty,per); 00041 } 00042 }
Generated on Fri Jul 15 2022 02:12:05 by
1.7.2