View Single Post
  #11   Spotlight this post!  
Unread 02-08-2015, 11:46 PM
Sn3akyP3t3 Sn3akyP3t3 is offline
Registered User
None #3277
 
Join Date: Feb 2015
Location: TRF
Posts: 2
Sn3akyP3t3 is an unknown quantity at this point
Re: Need help with arduino to i2c on roborio!

I saw this post awhile back and had come across a forum in the past that ensured that USB serial communication between the Raspberry Pi and Arduino is possible so I thought that it would be easy to setup a serial connection via USB. I looked at the online documentation for the WPILib SerialPort implementation and saw that documentation mentions "Driver for the RS-232 serial port on the RoboRIO".

Not being discouraged I tried some open source USB serial libraries and met failure with both of them. I figured I'll share my experience. RXTX, 64 bit precompiled binaries for Windows, was attempted, compiled, and transferred to the RoboRio, but once there it ran into runtime failure as something about the library was not available for some reason. The next library tried was java-simple-serial-connector or jSSC. This library looked promising as something quite simple with only one single jar file to add as a library in Eclipse. Unfortunately, as a WPILib project it fails to build, but has no problem as a Java application. Not sure what the issue is with that.

I returned to searching forums for some means of reading serial from USB and came across this post again. I decided to look at the code for SerialPort and I'm seeing that the option to read from USB appears to indeed exist as an option which I'm writing code for right now to test with, but ran out of time for the day. I'm hoping this is the solution and that it helps someone else. "usbSerialPort = new SerialPort(9600, Port.kUSB);" Some code example to work with for communicating between Arduino and a Pi, modify for Java, is http://www.bitsharr.com/rtxu6LvK
Reply With Quote