Pixy along with USB host shield (or another shield) on Arduino

Added by Kien Lam 8 months ago

I have a project about a robot, controlled by a logitech joystick.
The joystick connection is usb cable, so it needs a USB host shield to interface to Arduino.
The robot also has the function of looking and detecting object, and his eye is non other than Pixy.

The problem is, both USB host shield and Pixy require the icsp pin to connect to Arduino.

You see, if i connect the USB host shield to the Arduino, then I can't connect the Pixy to Arduino, and vice versa.

Is there any way to help these three devices working together?


Replies (3)

RE: Pixy along with USB host shield (or another shield) on Arduino - Added by Edward Getz 8 months ago

Hello Kien,
You can use the I2C interface on your Arduino to talk to Pixy instead of the ICSP (which uses SPI). We don't have a how-to guide on how to do this. It entails configuring Pixy for I2C communication and making your own communication cable to connect your Arduion I2C pins to the correct pins on Pixy, as well as tweaking the Arduino code.

There is some useful information here:

http://cmucam.org/projects/cmucam5/wiki/Porting_Guide

Hope this helps!

Edward

RE: Pixy along with USB host shield (or another shield) on Arduino - Added by Kien Lam 8 months ago

Thanks very much for your help, I tried connecting like this:

Pin 10 ➜ your controller's ground signal
Pin 9 (I2C SDA) ➜ your controller's I2C SDA signal
Pin 5 (I2C SCL) ➜ your controller's I2C SCL signal

I use Arduino mega 2560, which means SDA is pin 20 and SCL is pin 21.
And for power source I used the 5V output of Arduino.
The problem is, it seems that Pixy worked, I saw the white led and the bottom flashed, but the data couldn't be read.
I tried running the I2C sketch from the examples, but the serial monitor stuck at "Starting..."

and nothing more after that.

Do you know what problem is this?

BTW, the "hello_world" sketch works perfectly with the SPI connection, so this could be a problem of connection or software.

RE: Pixy along with USB host shield (or another shield) on Arduino - Added by Edward Getz 8 months ago

Hello Kien,
Note, if you are powering Pixy from the Arduino, the Arduino may be "browning out" because it can't supply enough power for Pixy. Using Pixy to power the Arduino is preferred. This page has some good information:

http://cmucam.org/projects/cmucam5/wiki/Powering_Pixy

Hope this helps.

Edward

(1-3/3)