Go to Post Mentors can either hide the experience of failure or support the right of a student in gaining that experience. - dcbrown [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 25-01-2014, 01:31
TomThompson TomThompson is offline
Registered User
FRC #0847
 
Join Date: Jan 2010
Location: Philomath, Oregon
Posts: 23
TomThompson is an unknown quantity at this point
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?
Reply With Quote
  #2   Spotlight this post!  
Unread 25-01-2014, 14:40
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 434
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
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.
__________________
http://team2168.org
Reply With Quote
  #3   Spotlight this post!  
Unread 27-01-2014, 09:15
Mike Bortfeldt Mike Bortfeldt is offline
Registered User
FRC #1126 (& 1511)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Rochester, NY
Posts: 119
Mike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud of
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
Reply With Quote
  #4   Spotlight this post!  
Unread 28-01-2014, 00:10
TomThompson TomThompson is offline
Registered User
FRC #0847
 
Join Date: Jan 2010
Location: Philomath, Oregon
Posts: 23
TomThompson is an unknown quantity at this point
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.
Reply With Quote
  #5   Spotlight this post!  
Unread 04-02-2014, 09:14
Chadfrom308's Avatar
Chadfrom308 Chadfrom308 is offline
Slave to the bot
AKA: Chad Krause
FRC #0308 (The Monsters)
Team Role: Driver
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Novi
Posts: 272
Chadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to beholdChadfrom308 is a splendid one to behold
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.
Reply With Quote
  #6   Spotlight this post!  
Unread 05-02-2014, 10:18
eddie12390's Avatar
eddie12390 eddie12390 is offline
Registered User
AKA: Eddie
FRC #3260 (SHARP)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Pittsburgh
Posts: 285
eddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of light
Re: i2c java and arduino

Quote:
Originally Posted by Chadfrom308 View Post
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.

Last edited by eddie12390 : 05-02-2014 at 10:21.
Reply With Quote
Reply


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 12:41.

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