Go to Post Just because there is a limit, doesn't mean that they don't love you. - Amanda M [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 11-17-2016, 06:40 AM
axton900's Avatar
axton900 axton900 is offline
Programming Co-Captain
FRC #1403 (Cougar Robotics)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: New Jersey USA
Posts: 45
axton900 has a spectacular aura aboutaxton900 has a spectacular aura aboutaxton900 has a spectacular aura about
How to get data from an Arduino and send it to a Roborio

Hey guys!
My team recently bought a rioduino in order to use some new sensors for next season. I have been able to find a plethora of code for sending values from roborio to an Arduino using i2c and have been able to accomplish the same, but the issue is that I have not been able to find code for doing the reverse operation(Arduino to RoboRio). Does anyone know how to accomplish this and if so could push us in the right direction?
Thanks
__________________
Team 1403: Cougar Robotics (2015 - present)

Reply With Quote
  #2   Spotlight this post!  
Unread 11-17-2016, 07:22 AM
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 296
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: How to get data from an Arduino and send it to a Roborio

Quote:
Originally Posted by axton900 View Post
Hey guys!
My team recently bought a rioduino in order to use some new sensors for next season. I have been able to find a plethora of code for sending values from roborio to an Arduino using i2c and have been able to accomplish the same, but the issue is that I have not been able to find code for doing the reverse operation(Arduino to RoboRio). Does anyone know how to accomplish this and if so could push us in the right direction?
Thanks
Code:
Wire.write(data);
?
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote
  #3   Spotlight this post!  
Unread 11-17-2016, 09:16 AM
Poseidon5817's Avatar
Poseidon5817 Poseidon5817 is online now
I'm not very good at giving prizes
AKA: Mitchel Stokes
FRC #5817 (Uni-Rex)
Team Role: Mentor
 
Join Date: Aug 2013
Rookie Year: 2014
Location: Clovis, CA
Posts: 334
Poseidon5817 is a splendid one to beholdPoseidon5817 is a splendid one to beholdPoseidon5817 is a splendid one to beholdPoseidon5817 is a splendid one to beholdPoseidon5817 is a splendid one to beholdPoseidon5817 is a splendid one to beholdPoseidon5817 is a splendid one to beholdPoseidon5817 is a splendid one to behold
Re: How to get data from an Arduino and send it to a Roborio

Quote:
Originally Posted by axton900 View Post
Hey guys!
My team recently bought a rioduino in order to use some new sensors for next season. I have been able to find a plethora of code for sending values from roborio to an Arduino using i2c and have been able to accomplish the same, but the issue is that I have not been able to find code for doing the reverse operation(Arduino to RoboRio). Does anyone know how to accomplish this and if so could push us in the right direction?
Thanks
Doesn't the RIOduino go into the MXP port on top? Why would you need I2C at that point?
__________________
My FRC History:

2014 - Team 1671: Central Valley Regional Finalist and Chairman's Award Winner, Sacramento Regional Finalist, Archimedes Quarterfinalist
2015 - Team 1671: Central Valley Regional Semifinalist, Sacramento Regional Semifinalist and Chairman's Award Winner, Newton Winner, Einstein Winner
2016 - Team 5817: Central Valley Regional Finalist and Rookie All-Star, Orange County Regional Quarterfinalist and Rookie All-Star, Newton Division


Reply With Quote
  #4   Spotlight this post!  
Unread 11-17-2016, 09:20 AM
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 296
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: How to get data from an Arduino and send it to a Roborio

Quote:
Originally Posted by Poseidon5817 View Post
Doesn't the RIOduino go into the MXP port on top? Why would you need I2C at that point?
MXP is a port with multiple connectors for different protocols: I2C, SPI, UART...
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote
  #5   Spotlight this post!  
Unread 11-17-2016, 10:12 AM
axton900's Avatar
axton900 axton900 is offline
Programming Co-Captain
FRC #1403 (Cougar Robotics)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: New Jersey USA
Posts: 45
axton900 has a spectacular aura aboutaxton900 has a spectacular aura aboutaxton900 has a spectacular aura about
Re: How to get data from an Arduino and send it to a Roborio

Yes. Arduino side, I simply did the write command but when I try and use the I2C read method, nothing is returned.
__________________
Team 1403: Cougar Robotics (2015 - present)

Reply With Quote
  #6   Spotlight this post!  
Unread 11-17-2016, 12:47 PM
mikets's Avatar
mikets mikets is online now
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 666
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: How to get data from an Arduino and send it to a Roborio

I2C devices have the concept of master/slave. Only the master can initiate a bus transaction. In your case, the RoboRIO is the master and the Arduino is the slave. So the RoboRIO needs to issue a command to get data from the Arduino. What exactly are you trying to read from the Ardino? You need to design a ReadData command so that the RoboRIO issues this command and the Arduino will respond by returning the data. Since the Arduino cannot initiate the bus transaction, if the data is "on-demand", you may need to have the RoboRIO "poll" for data periodically.
__________________
Reply With Quote
  #7   Spotlight this post!  
Unread 11-23-2016, 02:15 AM
TylerHarmon TylerHarmon is offline
Registered User
FRC #4499
 
Join Date: Jan 2016
Location: Westminster, CO
Posts: 5
TylerHarmon is an unknown quantity at this point
Re: How to get data from an Arduino and send it to a Roborio

Last year, I programmed an RGB light strip to go on our robot. It looked really good, but we wanted to be able to change what the lights were doing based on a condition in the match, or simply because we wanted to change them.

In the end, we just used four digital wires from the arduino to the roboRIO for communication, which gave us support for 2^4 = 16 light states. Of course, this is not the same as transmitting actual larger amounts of data, which would certainly require an analog communication. I2C should serve you well, or PWM, but if you don't need that much data to go from the Arduino to the RoboRIO, you could still use digital pins.

On a side note, why are you choosing to use the Arduino to control sensors? If you just wire the sensors to the roboRIO then you could skip this problem entirely.

Good luck!
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 08:24 PM.

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