Go to Post My mom's cousin heard from her friend who heard from her brother who heard from his barber who heard from his son that his teacher told him that his father's brother's sister's former roommate heard from Frank himself. - notmattlythgoe [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


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:53.

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