View Single Post
  #1   Spotlight this post!  
Unread 27-01-2017, 21:28
MamaSpoldi's Avatar
MamaSpoldi MamaSpoldi is offline
Programming Mentor
AKA: Laura Spoldi
FRC #0230 (Gaelhawks)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Shelton, CT
Posts: 309
MamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant future
Successful I2C connection to PixyCam in C++?

We used the pixycam last year... quite happily connecting to the digital/analog X interface format. It was so easy!

This year we were planning to use the I2C interface to the pixy to gather more data on the targets it sees. Unfortunately we are having no success in talking to the pixy using the I2C class in the WPILib (C++).

We created an I2C object as follows:

Code:
// note: 0x54 is the default address for the pixy (verified using PixyMon)
// ... and we have also tried the kOnBoard port option too
I2C *pixyI2C = new I2C(frc::I2C::kMXP, 0x54);
We have tried all of the following operations and all are returning true indicating an abort of the command (ie. fail):

Code:
uint8_t testvalues[2];
uint8_t pixyvalues[64];

pixyI2C->ReadOnly(64, pixyvalues);
pixyI2C->Read(0, 64, pixyvalues);
pixyI2C->Transaction(testvalues, 2, pixyvalues, 64);
pixyI2C->AddressOnly();
We have tried different size reads and different transactions. The AddressOnly() is supposed to tell you if it sees the device... apparently it does not.

We have also tried hooking up an oscilloscope to the SDA and SCL pins which both remain high all the time indicating that it is not receiving any signal. It does not even appear to send the start sequence to the I2C port. Although we have documentation about the packets pixy will send with the target details, unfortunately we don't have any documentation that provides any details of the commands that are required to be sent in order to get pixy to reply.

We would like to know if anyone has gotten the I2C interface work using the C++ version of the WPILib... especially interfacing to the PixyCam. On the other hand, any suggestions would be appreciated.
__________________
Reply With Quote