Go to Post ...after all these years Dean is still on message, and the message still resonates. - Richard Wallace [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:16.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi