Go to Post Like many researchers before me, I look and read about what my peers are doing and developing, and then incorperate the best of them into my ideas or change my focus because of them. - Wetzel [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 06-08-2016, 19:19
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 325
fovea1959 will become famous soon enough
Receiving data from Arduino over i2c?

just doing some off-season tinkering.

Students got comms going from Java to a RIODuino over I2C just fine; the Arduino Wire library's receive_slave example hooks up perfectly to the WPIlib I2C class write methods.

We're stumped on receiving data from the RIODuino. We added a onRequest handler to the Arduino receive_slave example.

If we do a
Code:
boolean b = rioDunio.read(44, yy.length, yy);
the Arduino gets a 1 byte onReceive event with the 44 register number. The Arduino's onRequest event never fires off.

If we do a
Code:
boolean b = rioDunio.readOnly(yy, yy.length);
and yy is a 6 byte array, and we have the Arduino's onRequest handler do a
Code:
Wire.write("hello ");
we can see the Arduino's onRequest handler firing off, but the readOnly call always returns a true value (indicating an aborted transfer), and the returned buffer is always full of zeroes.

Has anyone successfully read data from an Arduino using I2C?

We're prepared to do serial (and know how), but we are really trying to figure out the pros and cons of both, and want to make sure that we have an accurate idea of limitations of I2C between a RoboRIO and Arduino...
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 18:51.

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