![]() |
i2c java and arduino
We are trying to figure out how to read data from an arduino through i2c. We have three ultrasounds that are running on the arduino and probably can figure how to move the data to i2c on the arduino. I just haven't seen much on how to read the data from the cRio. The ultrasounds we are using are the ping ultrasounds from Parallax. Since they would have to be connected to at least two digital ports on the break out board per sensor, we thought arduino would be a good way to reduce the demand on that resource. Any suggestions?
|
Re: i2c java and arduino
|
Re: i2c java and arduino
Tom,
This thread may also have some information you can use. The bug regarding values>127 being sent to the Arduino is fixed in this years version. Mike |
Re: i2c java and arduino
We have been using that thread for some ideas. Thanks for posting the code there. So far we have two arduinos talking to each other using i2c. The slave has three parallax ultrasounds and the master is simply collecting that data and printing the data to the serial monitor. Once we know that is working well, we will replace the arduino master with the cRio. Other than what needs to go in the constructor, it appears we many only need to use the read method in java to read three consecutive bytes that will represent the 3 distances on the three parallax sensors.
The whole system will read 5 sensors and the arduino will choose which three to send on to the cRio. Two of the three will be pointed at the side wall to help keep the robot moving straight during autonomous. Lots of other ways to do this but this seemed most interesting and a new challenge. |
Re: i2c java and arduino
We are trying to get i2c working as well. It looks possible. We are going to try and put LED's that signal whether our robot is lined up for a shot, if we need a ball from the human player, random decorations, and stuff like that.
The vision processing will be on the driver station, then whether we are lined up will be passed to the CRIO then to the Arduino which will turn on the lights. We have a bunch of addressable lights that we want to put on. BTW, does anybody know if we are aloud to put capacitors on the strips of lights? I don't want the lights dimming when we accelerate the robot. |
Re: i2c java and arduino
Quote:
Code:
R72 |
| All times are GMT -5. The time now is 22:34. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi