Nexus Automation Nexus Robot User Manual page 99

Kits
Table of Contents

Advertisement

www.nexusrobot.com
void checkIRs() {
for(int i=0;i<3;++i) {
IRs[i]=digitalRead(IRpin[i]); // Save datas
Serial.print(IRs[i]);
}
Serial.println("");
}
/********************************************/
/*******************************************/
// Wheels
irqISR(irq1,isr1);
MotorWheel wheel1(9,8,6,7,&irq1);
irqISR(irq2,isr2);
MotorWheel wheel2(10,11,14,15,&irq2);
irqISR(irq3,isr3);
MotorWheel wheel3(3,2,4,5,&irq3);
//MotorWheel wheel3(5,4,2,3,&irq3);
Omni3WD Omni(&wheel1,&wheel2,&wheel3);
/******************************************/
/******************************************/
// demo
unsigned long currMillis=0;
void demoWithSensors(unsigned int speedMMPS,unsigned int distance,unsigned int ms) {
if(millis()-currMillis>SONAR::duration) {
currMillis=millis();
sonarsUpdate();
}
checkIRs();
// Read the Anti-drop Sonars
// display the datas
// Pin9:PWM, Pin8:DIR, Pin6:PhaseA, Pin7:PhaseB
// Pin10:PWM, Pin11:DIR, Pin14:PhaseA, Pin15:PhaseB
// Pin3:PWM, Pin2:DIR, Pin4:PhaseA, Pin5:PhaseB
// This will create a Omni3WD object called Omni. then You
// can use any of its methods; for instance, to
// control a Omni3WD attached to pins, you could write
// Every 60 ms call the SonarsUpdate() once time
// check the Anti-drop sonars
Robot Kits manual
95

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Nexus Robot and is the answer not in the manual?

Questions and answers

Table of Contents