Quote:
Originally Posted by 2B || !2B
!lI have been tasked with creating a master class (Java) for all things I2C because the last time we used it, the robot had some major lag issues, and once the sensor crashed the robot so hard it stopped moving during competition.
|
I don't think you want the try to make some generic "master class" where you attempt to handle more than just the device in question. The class provided is already the master class!
Quote:
Originally Posted by Chadfrom308
I've only heard of a couple teams that have gotten I2C to work well (besides the accelerometer). What I would personally do is get an arduino and a CAN shield and read the sensors using I2C on arduino and then send the data over CAN. I am on a Formula SAE team and we are doing something similar to this and it works really well.
Also, Teensy 3.1 has CAN built in (minus a microchip for the i/o for CAN) and that has something like 22 analog ins, so if you are reading lots of sensors (like the Formula team I am on) you could use that to read sensors too.
|
That sounds like a pretty complex solution to a simple problem. There would have to be some extenuating circumstances to warrant such a design.
Quote:
Originally Posted by 2B || !2B
I couldn't tell you how many times the sensor's been hot-plugged accidentally by the death spirals that were supposed to be a closed loop drive system! I can't believe it still works...
|
Most simple sensors like I2C sensors don't care if you hot-plug them. They just see it as powering up.
Quote:
Originally Posted by RufflesRidge
Have you tried writing to non-Jaguar CAN devices on the cRIO? Or to arbitrary CAN devices on the roboRIO? WPILib does not currently have any user APIs for arbitrary CAN devices/traffic. This seems substantially harder than just getting I2C to work on the roboRIO itself.
|
LabVIEW has a generic API for accessing CAN. If Java doesn't, that may be a bug.