View Single Post
  #6   Spotlight this post!  
Unread 08-11-2014, 21:11
DavidBlain DavidBlain is offline
Registered User
FRC #0839
 
Join Date: Nov 2014
Location: Agawam, MA USA
Posts: 7
DavidBlain is an unknown quantity at this point
Re: How to use FTC hi-tech motor controllor on FRC

I'm also trying to connect the FTC HiTechnic motor controller to a cRIO/digital sidecar. Our intention is to use it purely as a programming training platform. I'm planning on implementing a standard motor controller wrapper class that mimics a Jaguar CAN controller. (the HiTechnic controller supports PID, encoders, etc)

I've been able to connect and control it using an arduino (just so I could verify it was possible).

When I use java on the cRio, it fails. Here are some traces of the i2c bus from the arduino and the crio (the request is to read the vendor name from the controller):

Arduino -


cRIO -


For some reason the crio sends the device address (0x02) and then a NAK with none of the rest of the data (i.e. Register # 0x08)

Here is the cRIO code that I used to generate the capture:

Code:
        I2C i2c = m_module.getI2C( 0x02 );     
        
        while (true)
        {
            byte[] deviceData = new byte[4];

            i2c.read( 0x08, 4, deviceData);

            System.out.print( (char)deviceData[0] );
        
            try
            {
            Thread.sleep( 250 );
            }
            catch( InterruptedException e )
            {}
        }
Thanks for any insights you can provide

David Blain
Rosie Robotics #839