昵称:烦夫子
类别:界面/平面设计师
年龄:38
现所在地:北京
主页浏览总数:24259
总积分:89
文章数:88
作品数:70
开放源码
数控切绘机控制程序源代码
测试功能
/*测试子程序*/
void prog3(void)
{
uchar j_x=0;
uint i; /*画40*40的菱形*/
bit dbzh_sign=0;
//显示测试
display2(0,qingpin);
display2(1,qingpin);
display3(0xb8,16,62,0,0);
display3(0xb8,29,63,0,1);
TAIBI();
//back();
dbzh_sign=dbzh; //把刀/笔的状态值保存下来,因为在INDEAL里把DBZH的值都缺省为笔了
indeal();
//dbzh=dbzh_sign; //恢复刀/笔的状态值
//xzz(8000); /*画40*40的正方形,先到起点再开始画正方形*/
//yzz(2000);
/*if(dbzh==0)
{
yzz(24*80+BFY*12);
}
else
{
;
}*/
if(dbzh!=dbzh_sign) //如果要从笔到刀:当前为笔
{
dbzh=dbzh_sign;
//j_y=80*24+B_DBFY*12;
for(i=0;i<80*24+B_DBFY*12;i++) //24为刀笔头的距离 distance
{
outzy1( );
delay(60);
}
if (B_DBFX>=0) //走X方向
{
j_x=B_DBFX*12;
for(i=0;i<j_x;i++)
{
outzx1( );
delay(60);
}
}
else
{
j_x=-B_DBFX*12;
for(i=0;i<j_x;i++)
{
outfx1( );
delay(60);
}
}
}
step_ground=10;step_ground1=step_ground; //每级台阶宽度(步数)
speedup_steps=5; //梯形速度曲线
speedup=0;
RollSteps=19900;
h_line(16000,4000);
//PU_XIAN(16000,4000);
if(dbzh==0)
{DEEP=40-DEEP_D;
LUOBI();}
else
{
DEEP=40+DEEP_B;
LUOBI();
}
PU_XIAN(24000,24000);
PU_XIAN(-24000,-24000);
/*xzz(24000);
TAIBI();
LUOBI();
yzz(24000);
TAIBI();
LUOBI();
xfz(24000);
TAIBI();
LUOBI();
yfz(24000);*/
TAIBI();
indeal();
goto overce;
cel:
while(key_7289==1);
switch (keyin())
{
//case 0x0a:
case 0x12:
{
ceram(); /*按下向上箭测试EXRAM*/
goto cel;
}
case 0x24: {celed(); goto cel;} /*按下左边箭测试LED*/
//case 0x13: {ceio(4); goto cel;} /*按下右边见测试IO*/
case 0x30: {end();}break;
default:
delay1s(1);
goto cel;
overce:
;}
}