www.nexusrobot.com Robot Kits manual
68
setCarSpeedMMPSArc(speedMMPS,getRadiusMM(),uptime);
}
delayMS(duration,debug);
//duration=5000 the car moves this action willl last 5000
milliseconds
setCarSlow2Stop(uptime);
//uptime=500 set the car stop in 500 milliseconds
}
}
¾
R2WD_test
Here’s an example ,we use it to test a car with two wheels.after this ,you will More thorough
understanding of the library
Simple code:
#include <MotorWheel.h>
#include <R2WD.h>
#include <PID_Beta6.h>
#include <PinChangeInt.h>
#include <PinChangeIntConfig.h> // Include the header files
/*
Wheel1 ||-----|| Wheel2
*/
irqISR(irq1,isr1);
// Intterrupt function.on the basis of the pulse ,work for wheel1
MotorWheel wheel1(9,8,4,5,&irq1,REDUCTION_RATIO,int(144*PI));
//This
will
create
a
MotorWheel
object
called
Wheel1
//Motor PWM:Pin9, DIR:Pin8, Encoder A:Pin4, B:Pin5
irqISR(irq2,isr2);
Summary of Contents for Nexus Robot
Page 74: ...www nexusrobot com Robot Kits manual 70 Sample Wiring Diagram for RB004 2WD V2 0...
Page 92: ...www nexusrobot com Robot Kits manual 88 Diagram for Omni3WD_V1 0...
Page 96: ...www nexusrobot com Robot Kits manual 92 Diagram_Omni3WD_V3 3...
Page 118: ...www nexusrobot com Robot Kits manual 114 Sample Wiring Diagram for RB011 Mecanum 4WD V4 1...