Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   i2c java and arduino (http://www.chiefdelphi.com/forums/showthread.php?t=125197)

TomThompson 25-01-2014 01:31

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?

otherguy 25-01-2014 14:40

Re: i2c java and arduino
 
This post might help.

If you get it working, share your code so others can use it in the future.

Mike Bortfeldt 27-01-2014 09:15

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

TomThompson 28-01-2014 00:10

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.

Chadfrom308 04-02-2014 09:14

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.

eddie12390 05-02-2014 10:18

Re: i2c java and arduino
 
Quote:

Originally Posted by Chadfrom308 (Post 1337383)
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.

Code:

R72

A noise filter may be wired across motor leads or PWM leads.  Such filters will not be considered CUSTOM CIRCUITS and will not be considered a violation of R53 or R71.

Acceptable signal filters must be fully insulated and must be one of the following:

    A one microfarad (1 µF) or less, non-polarized, capacitor may be applied across the power leads of any motor on your ROBOT (as close to the actual motor leads as reasonably possible).

I'm not sure how exactly this would apply to a light strip, if it's allowed on a generic PWM lead it would seem to make sense that you could use it for your lights.


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