![]() |
Arduino & Roborio cant find each other I2C Issues
code: http://pastebin.com/9uq4S2dQ
Okay, so I'm trying to scan through all the possible addresses that the arduino could be from both Roborio (our code here) and Arduino (Arduino used I2C scanner code: http://playground.arduino.cc/Main/I2cScanner) We have verified the wiring of the arduino is correctly wired with A4 and A5 connected to the I2C and ground and power to the I2C port of roborio. Both devices can't find each other. Anyone have a solution to make both devices find each other? (Strangely enough we can have Roborio send data to Arduino and Arduino read it but the Arduino can't successfully send data to the roborio with the Roborio giving a response like a System.out.println() in the DriverStation console) |
Re: Arduino & Roborio cant find each other I2C Issues
Is your arduino configured as a slave?
|
Re: Arduino & Roborio cant find each other I2C Issues
Quote:
In I2C, slaves can only send data for a transaction, not any time they want. For Arduino, that means you can only write in the onRequest handler function, and only the number of bytes the master expects. On the roboRIO side, you need to call I2C.transaction() |
Re: Arduino & Roborio cant find each other I2C Issues
We've done exactly that, but for some reason onRequest was not being triggered... Any ideas how to troubleshoot this?
|
Re: Arduino & Roborio cant find each other I2C Issues
Quote:
|
Re: Arduino & Roborio cant find each other I2C Issues
Roborio code: http://pastebin.com/TiFcYq6L
Arduino: http://pastebin.com/TDPk9W5i Do keep in mind we did try using onREquest for arduino and set it up as a slave prior but for some reason it didnt work. :( My team is confused, even the mentor is having trouble explaining what's happening. |
Re: Arduino & Roborio cant find each other I2C Issues
I see. Try this
roboRIO: Code:
static I2C arduino = new I2C(Port.kOnboard, 42);Code:
#include <Wire.h> |
Re: Arduino & Roborio cant find each other I2C Issues
The Arduino didn't read anything from the roborio using this code. We've since switched to using a raspberry pi
|
| All times are GMT -5. The time now is 21:48. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi