Manual

www.nexusrobot.com Robot Kits manual
112
¾ Omni4WD_test
Here’s an example ,we use it to test a car with four wheels.after this ,you will More thorough
understanding of the library
Simple code:
#include <MotorWheel.h>
#include <Omni3WD.h>
#include <Omni4WD.h>
#include <PID_Beta6.h>
#include <PinChangeInt.h>
#include <PinChangeIntConfig.h>
// Include the header files
/*
\ /
wheel1 \ / wheel4
Left \ / Right
/ \
wheel2 / \ wheel3
Right / \ Left
*/
irqISR(irq1,isr1); // Intterrupt function.on the basis of the pulse,work for wheel1
MotorWheel wheel1(3,2,4,5,&irq1);
//This will create a MotorWheel object called Wheel1
//Motor PWM:Pin5, DIR:Pin4, Encoder A:Pin12, B:Pin13
irqISR(irq2,isr2);
MotorWheel wheel2(11,12,14,15,&irq2);
irqISR(irq3,isr3);