www.nexusrobot.com Robot Kits manual
86
¾
Omni3WD_test
Here’s an example ,we use it to test a car with three 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
/*
Wheel3
// \\
Wheel2
==
Wheel1
*/
irqISR(irq1,isr1);
//
Intterrupt
function.on the basis of the pulse ,work for wheel1
MotorWheel wheel1(9,8,6,7,&irq1); //This will create a MotorWheel object called Wheel1
//Motor PWM:Pin9, DIR:Pin8, Encoder A:Pin6, B:Pin7
irqISR(irq2,isr2);
MotorWheel wheel2(10,11,12,13,&irq2);
irqISR(irq3,isr3);
MotorWheel wheel3(3,2,4,5,&irq3);
//MotorWheel wheel3(5,4,2,3,&irq3);
// why not this?? Because the pin 5,pin 6 control by timer 0
Omni3WD Omni(&wheel1,&wheel2,&wheel3);
// This will create a Omni3WD object called Omni3WD.
//You can then use any of its methods; for instance,
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...