I have my Pixie2 mounted on a Zumo robot for Arduino. I am trying to get the robot to chase a red ball. I am using the “ccc_zuno_chase_1” Sketch which I found in the Pixie2 folder. This sketch compiles without error and the pixie2 tracks the ball very nicely. Everything appears to be working except the motors do not run.
Hi, please see my email response - let me know if that helps!
Cheers,
Jesse
I am still trying to get the motors to run. I am running the sketch “line_zumo_demo”. I have had a lot of problems with some sketches not compiling if compiling then not uploading. However, this sketch compiles and uploads without errors. I drew a line
on a piece of white printer paper and I can see by looking at PixyMon that it is tracking the vector. As I move the paper from left to right the vector numbers change and what I see in PixieMon responds accordingly. When I print out the “motors.SetRightSpeed” and “motors.SetRightSpeed” the numbers appear reasonable. When I adjust the paper so that the arrow in PixieMon is straight up the left and right numbers are the same, 200.
When I tested with sketch “ccc_zuno_chase_1” the pixie camera tracked my target red ball and appeared to be operating normally but again the motors would not run.
I am not completely sure who I should be dealing with on this problem whether it should be Pixy Forum or Pololu
Hello,
Have you tried testing your Zumo motors? Try running this program:
#include <ZumoMotors.h>
#include <ZumoBuzzer.h>
ZumoMotors motors;
ZumoBuzzer buzzer;
void setup()
{
Serial.begin(115200);
Serial.print("Starting...\n");
}
void loop()
{
Serial.println("Left forward");
motors.setLeftSpeed(200);
motors.setRightSpeed(0);
delay(2000);
Serial.println("Right forward");
motors.setLeftSpeed(0);
motors.setRightSpeed(200);
delay(2000);
Serial.println("Left reverse");
motors.setLeftSpeed(-200);
motors.setRightSpeed(0);
delay(2000);
Serial.println("Right reverse");
motors.setLeftSpeed(0);
motors.setRightSpeed(-200);
delay(2000);
Serial.println("Buzzer");
motors.setRightSpeed(0);
buzzer.playFrequency(500, 500, 15);
delay(1000);
}
Left, right, forward and reverse are with respect to an imaginary (and tiny) driver-person sitting on the Zumo and facing forward. The Zumo’s power switch and LEDs are at the back of the Zumo, so the imaginary driver will face opposite (looking away from) the power switch and LEDs.
Make sure the Zumo motors move as described in the above program. Don’t forget to insert batteries and turn the Zumo power switch on before running the test.
Edward
I loaded the sketch that you sent and it compiles and uploads normally. I replaced the batteries in my Zumo just to be on the safe side. I turned the power switch on. I brought up the serial monitor and it shows the program cycling through the commands however, the motors do not run.
I had tried testing the motors with the sketch entitled “motor test” . It compiles but does not upload successfully. Here is a line from the error message: C:\Users\Gilbert Naramor\Documents\Arduino\libraries\Zumo32U4/Zumo32U4.h:13:2: error: #error “This library only supports the ATmega32U4. Try selecting A-Star 32U4 in the Boards menu.”
#error “This library only supports the ATmega32U4. Try selecting A-Star 32U4 in the Boards menu.”
It suggest selecting the A-Star 32U4 in the Boards menu. I do not have this board in my boards menu. The closest thing that I have is the Adafruit 32U4 breakout. I tried this but it still will not compile. I compiled with the Adafruit Board and it compiled but got an error trying to upload.
Please confirm that I should be selecting the . " Arduino/ Genuino Uno" board.
Hmm. What Arduino are you using?
I am using a genuine Arduino Uno Rev 3
Hello,
What version of the Arduino IDE are you using? Have you tried the latest version?
Edward
I am using Version Arduino 1.8.10
I just posted this to the Pololu forum: " I disconnected the Pixie2 from the Arduino Uno and unplugged the Servo connections. I downloaded the Zumo motor example from github per your instructions. The sketch compiled and uploaded normally and when I ran it the motors did not run… however, when I Picked the Zumo up to move it to a different place on my desk I must have squeezed the Zumo and the Arduino Uno together and the motors began to run. It appears that the Arduino was not seated properly in the Zumo shield. I have tested it several times and the motors are working normally after I reconnected the camera and the servos".
The pan and tilt mechanism works in PixyMon. My next step is to move on to the “Pxie_Pet_Robot” sketch and the “line following sketch”.
Nice work – sometimes the connection issues are challenging to track down.