常驻嘉宾
- 积分
- 4823
- 威望
- 2464
- 贡献
- 1341
- 兑换币
- 929
- 注册时间
- 2010-12-25
- 在线时间
- 509 小时
|
光电:
void main(void)
{
DisableInterrupts;
Init();
YeJing_LED=1;
LCD_Print(0,0,"1aserLine");
LCD_Print(0,1,"2:TestLaserRec");
LCD_Print(0,2,"3:TestYaoTou");
LCD_Print(0,3,"4:TestHongWai");
LCD_Print(0,4,"5:TestRun");
LCD_Print(0,5,"6:Run");
switch(Select_Function())
{
case 1:
for(;;)
{
U_Laser_A=1;
D_Laser_A=1;
DLY_ms(5);
U_Laser_A=0;
U_Laser_B=1;
D_Laser_A=0;
D_Laser_B=1;
DLY_ms(5);
U_Laser_B=0;
U_Laser_C=1;
D_Laser_B=0;
D_Laser_C=1;
DLY_ms(5);
U_Laser_C=0;
D_Laser_C=0;
DLY_ms(5);
}
break;
case 2:
for(;;)
{
DLY_ms(500);
TestLaserRec();
}
break;
case 3:
TestYaoTou();
break;
case 4:
Test();
break;
case 5:
DLY_ms(500);
Set_CanShu();
speed_tab_init();
DLY_ms(2000); //2S自启动
PACNT=0;
U_Laser_C=1;
EnableInterrupts;
QiPao();
for(;;)
{
Engine_Protect();
QiPao_Process();
Laser_Process();
}
case 6:
DLY_ms(500);
Switch_Dang();
speed_tab_init();
DLY_ms(2000); //2S自启动
PACNT=0;
U_Laser_C=1;
EnableInterrupts;
QiPao();
for(;;)
{
Engine_Protect();
QiPao_Process();
Laser_Process();
}
}
// please make sure that you never leave main
} |
|