www.nexusrobot.com Robot Kits manual
85
void
Omni3WD::demoActions
(unsigned int speedMMPS,unsigned int duration,unsigned int uptime,bool
debug) {
unsigned int (
Omni3WD::*carAction
[])(unsigned int speedMMPS)={
&Omni3WD::setCarAdvance, //set car moves forward
&Omni3WD::setCarBackoff,
//set car moves Reverse
&Omni3WD::setCarLeft,
//set car turn left
&Omni3WD::setCarRight,
//set car turn right
&Omni3WD::setCarRotateLeft,//set car rotate left
&Omni3WD::setCarRotateRight //set car rotate right
};
for(int i=0;i<6;++i) {
//there are six base actions
(this->*carAction[i])(0);
//choose one of the six actions
setCarSpeedMMPS(speedMMPS,uptime);
// set the speed for the car in this action
delayMS(duration,debug);
// The time used for the car moves at this
speed in this action
setCarSlow2Stop(uptime); //set
the
car
stop
slowly
in
uptime
}
setCarStop();
//set car stop
delayMS(duration,debug);
//delay(duration) every 10 milliseconds
call the PIDRegulate once time
switchMotorsLeft();
//rotate
left
to
change
the
wheel
to
work
}
Содержание Nexus Robot
Страница 74: ...www nexusrobot com Robot Kits manual 70 Sample Wiring Diagram for RB004 2WD V2 0...
Страница 92: ...www nexusrobot com Robot Kits manual 88 Diagram for Omni3WD_V1 0...
Страница 96: ...www nexusrobot com Robot Kits manual 92 Diagram_Omni3WD_V3 3...
Страница 118: ...www nexusrobot com Robot Kits manual 114 Sample Wiring Diagram for RB011 Mecanum 4WD V4 1...