#include
#include
#define uchar unsigned char
#define uint unsigned int
#define false 0
#define true 1
#define High 1
#define Low 0
//舵机控制引脚
sbit SERVO_SB1 = P1^0; //上臂1
sbit SERVO_SB2 = P1^1; //上臂2
sbit LED = P1^2;
sbit KEY1 = P2^0;
sbit KEY2 = P2^1;
sbit KEY3 = P2^2;
sbit KEY4 = P2^3;
sbit KEY5 = P2^4;
sbit KEY6 = P2^5;
uchar ComDat;
//调节范围5-19,对应舵机的0-180度
uchar pwm_val_SJ =0; //上夹子
uchar pwm_val_SB1 =0; //上夹子1臂
uchar pwm_val_SB2 =0; //上夹子2臂
uchar push_val_SJ =0;
uchar push_val_SB1 =0;
uchar push_val_SB2 =0;
uchar SB1_Val = 0;
uc