www.nexusrobot.com
analogWrite(MOTOR3_E,53); //forward run motor3
}
void Right(){
analogWrite(MOTOR1_E,66);
analogWrite(MOTOR2_E,40);
analogWrite(MOTOR3_E,40);
}
//************************************************//
void RotateRight(){
analogWrite(MOTOR1_E,66);
analogWrite(MOTOR2_E,62); //forward run motor2
analogWrite(MOTOR3_E,64);
}
//*************************************************//
void RotateLeft(){
analogWrite(MOTOR1_E,36); // reverse run motor 1
analogWrite(MOTOR2_E,32); // reverse run motor 2
analogWrite(MOTOR3_E,34);
}
//**************************************************//
void allStop(){
analogWrite(MOTOR1_E, 48);
analogWrite(MOTOR2_E, 44);
analogWrite(MOTOR3_E, 46);
}
//*************************************************//
void (*motion[7])()={ goAhead,getBack,Left,Right,RotateLeft,RotateRight,allStop};
void demotion(){
for(int i=0;i<7;i++){
(*motion[i])();
delay(3000);
}
}
//*************************************************//
void setup() {
TCCR1B=TCCR1B&0xf8|0x04; //PIN 9 and PIN 10 cotroled by Timer1
TCCR2B=TCCR2B&0xf8|0x06; //PIN 11 and PIN 3 cotroled by Timer2
//forward run motor1
//Reverse run motor2
//Reverse run motor3
//forward run motor1
//forward run motor3
// reverse run motor 3
//stop run motor1
//stop run motor2
//stop run motor3
// The demotion have 8 actions
// call the action
// Each action last 3000 milliseconds
Robot Kits manual
122HZ
122HZ
120
Need help?
Do you have a question about the Nexus Robot and is the answer not in the manual?
Questions and answers