<< return to Pixycam.com

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

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.
!http://i.imgur.com/ecgetkG.jpg?1! !http://i.imgur.com/cRpo2HD.jpg?1!
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?

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

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…”
!http://i.imgur.com/9EuFCLb.jpg!
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.

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