if(ps_sw(ps_add,p_start)==0)
{
rs_en(add_rs,0,1);
}
else if(ps_sw(ps_add,p_square)==0)
{
while(ps_sw(ps_add,p_square)==0);
while(1)
{
rs_pos_sp(add_rs,3,5000,50);
rs_pos_sp(add_rs,3,0,50);
}
}
else if(ps_sw(ps_add,p_circle)==0)
{
while(ps_sw(ps_add,p_circle)==0);
while(1)
{
rs_pos_sp(add_rs,2,position_a,speed_b);
pos=rs_read_pos(add_rs,2);
while(pos!=position_a)
{
pos=rs_read_pos(add_rs,2);
}
pos=rs_read_pos(add_rs,2);
while(pos!=1500)
{
pos=rs_read_pos(add_rs,2);
}
}
}
else if(ps_sw(ps_add,p_cross)==0)
{
while(ps_sw(ps_add,p_cross)==0);
while(1)
{
rs_pos_sp(add_rs,1,position_a,speed_b);
pos=rs_read_pos(add_rs,1);
while(pos!=position_a)
{
pos=rs_read_pos(add_rs,1);
}
pos=rs_read_pos(add_rs,1);
while(pos!=2500)
{
pos=rs_read_pos(add_rs,1);
}
}
}
else if(ps_sw(ps_add,p_select)==0)
{
while (ps_sw(ps_add,p_select)==0);
while(1)
{
slave_reset=1;
}
}
}
}
Users browsing this forum: No registered users and 5 guests