void steer(uint8 duty_ms) { switch(duty_ms*10)
{
case 50 WMDTY1=15000; //-90 //舵机转角
case 80 :PWMDTY1=25600; //-60
case 90 :PWMDTY1=28800; //-54
case 100:PWMDTY1=32000; //-45
case 110:PWMDTY1=35200; //-36
case 115:PWMDTY1=36800; //-31.5
case 120:PWMDTY1=38400; //-27
case 125:PWMDTY1=40000; //-22.5
case 130:PWMDTY1=41600; //-18
case 135:PWMDTY1=43200; //-13.5
case 140:PWMDTY1=44800; //-9
case 145:PWMDTY1=46400; //-4.5
case 150:PWMDTY1=48000; //0
case 155:PWMDTY1=49600; //4.5
case 160:PWMDTY1=51200; //9
case 165:PWMDTY1=52800; //13.5
case 170:PWMDTY1=54400; //18
case 175:PWMDTY1=56000; //22.5
case 180:PWMDTY1=57600; //27
case 185:PWMDTY1=59200; //31.5
case 190:PWMDTY1=60800; //36
case 195:PWMDTY1=62400; //40.5
case 200:PWMDTY1=64000; //45
case 210:PWMDTY1=67200; //54
case 220:PWMDTY1=70400; //60
}
}
我的qq:929678754