<< return to Pixycam.com

Line Tracking Pixy2 motor problem

Hello everybody,
I have the following Problem:
When I start my program I see on the serial console the results of the coordinates of the inital vector and the end vector. And i see in which direction should my robot drive. But the right motor does not drive. If I use only the program for the motor engine, then I can perfectly control both motors, but when I use the command “pixy.init()” or “pixy.changeProg(“line”)”, then i loose the control of the right motor.
In the Attachment you can find my code.

I hope somebody could help me:)


Greeting Sandro!

Hello,
Hmm, that sounds odd. What robot platform or motor controller are you using?

Edward

Hello,
Im using the sparkfun motor driver. My engine works perfectly. Only when I use the pixy commands(pixy.init() and pixychangeProg(“line”), I cant control the right wheel. When I delete these commands from my code I can control both wheel perfectly.

Greeting Sandro

Hello,
I’m not familiar with the Sparkfun motor driver. Can you provide a link?

Pixy uses the SPI port. Perhaps the motor driver uses the I/O that shares the SPI port. It sounds like they may be incompatible.

Edward

Hello,
here is the link of the motor driver:

If this motor driver were incompatible, then both wheels would not spin, but through the pixy camera, the left wheel rotates when it detects a vector.
Do I have to add anything to my code except “#include <SPI.h>”

Sandro

Hello,

Note the ICSP port (SPI port) uses I/O bits PB1, PB2, and PB3. I’m guessing your motor driver uses at least one of these pins.

Edward

Hello,
In the picture you can see how I connected the Arduino to the motor driver. I did not add the switch.

Sandro