Go to Post Those teams with too much pride will hinder their alliance. Know your strengths and weaknesses and be honest about them. - Andy Brockway [more]
Home
Go Back   Chief Delphi > Technical > Electrical
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
  #4   Spotlight this post!  
Unread 03-02-2013, 10:02
tuyauxtu tuyauxtu is offline
Registered User
FRC #0781 (Kinetic Knights Robotics)
Team Role: Mentor
 
Join Date: May 2010
Rookie Year: 2010
Location: Kincardine, Ontario
Posts: 22
tuyauxtu is an unknown quantity at this point
Re: VEX 393 Encoder Issues

Hi, I went under the assumption that as an I2C bus device it could not be connected to the DIO portion of the DSC like a regular USDigital encoder.

The encoder cable has white (data), yellow (clock), red (+5V) and black (ground). We made up a female-female connector so that the red maps to the top I2C pin in the DSC (5V), the yellow to the next pin down (SCL), the white to the SDA and the black to ground. I'd appreciate it if you could post your c++ code if you are reading values from the I2C bus.

I can read the encoder in java by extending the SensorBase class (trying to mimic devices like the HiTechnicColorSensor and HiTechnicCompass), however the data is not making sense:
The returned values for the device information seem to be missing the last byte in each address (getting only 7 of the 8, first clue something's not right!), and when I read the addresses 0x40 upwards (per http://www.vexforum.com/wiki/index.p...Motor_Encoders, compensating for the unsigned integers, I get what looks like individual values in each address which follow the motor rotation but the MSB and LSB rotation tick bits 0x40 and 0x41 seem to be reversed (second clue). I doubt that I am using the I2C read method correctly in that I should be able to read, say 4 bytes in one go, starting at 0x40 and get the first rotation bytes, then combine them to an integer number that counts up and down as the motor moves. Comes out as garbage, third clue.

FRC Team 781's experience so far, I'll post if I make any progress.
Pat

Last edited by tuyauxtu : 03-02-2013 at 11:40. Reason: corrected url
 


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 06:11.

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