void handle_nled();
void handle_duoji(); //声明舵机处理函数
void handle_uart1(); //声明串口处理函数
void handle_ps2(); //声明PS2处理函数
void handle_warning(void); //声明低压报警函数
void dida(u8 times, u8 frequency);//声明滴答函数
void handle_auto_group(void);
void setup() {
pinMode(BEEP_PIN, OUTPUT);
pinMode(NLED_PIN, OUTPUT);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
Serial.begin(115200 );
ps2x.config_gamepad(PS2_CLK, PS2_CMD, PS2_ATT, PS2_DAT, true, true);//配置PS2手柄
type = ps2x.readType();//返回PS2类型
switch(type) {
case 0:
Serial.println("Unknown Controller type");
break;
case 1:
Serial.println("DualShock Controller Found");
break;
case 2:
Serial.println("GuitarHero Controller Found");
break;
}
for(byte i = 0; i < DJ_NUM; i++) {//循环使相应的舵机伺服对象连接到对应的引脚
myservo[i].attach(duoji_pin[i]);
}
for(byte i = 0; i < DJ_NUM; i++) {
myservo[i].writeMicroseconds(duoji_doing[i].aim);//循环写入初始PWM目标值
}
dida(3, 50);
Motor_Stop();
delay(1000);
}
the Motor_Stop() is the error. i just searched it in the internet and please help me. or if someone knows how to code a 4dof robotic arm. please help