Manual
www.nexusrobot.com Robot Kits manual 
  115
¾  4WD platform with 4 SONAR 
Look the above figure of simple Wiring Diagram for RB011 ,Mecanum 4WD V4.1. this code is matched 
for it 
4WD platform with 4 SONAR code 
#include <MotorWheel.h> 
#include <Omni4WD.h> 
#include <PID_Beta6.h> 
#include <PinChangeInt.h> 
#include <PinChangeIntConfig.h> 
#include <SONAR.h> // Include the header files   
/* 
************************************************************************************ 
 Sonar:0x12 
 --------------------------------- 
 | | 
 M3 | | M2 
 | | 
 Sonar:0x13 | | Sonar:0x11 
 | | 
 | | Power Switch 
 | | 
 | | 
 ----------------------------------- 
 | | 
 M4 | | M1 
 | | 
 ------------------------------------ 
 Sonar:0x14 
************************************************************************************ 
*/ 
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:Pin3, DIR:Pin2, Encoder A:Pin4, B:Pin5 
irqISR(irq2,isr2); 
MotorWheel wheel2(11,12,14,15,&irq2); 
irqISR(irq3,isr3); 
MotorWheel wheel3(9,8,16,17,&irq3); 










