View Single Post
  #16   Spotlight this post!  
Unread 28-05-2012, 00:47
JoshSmith JoshSmith is offline
LED Junkie
FRC #0111 (WildStang)
Team Role: Mentor
 
Join Date: May 2011
Rookie Year: 2009
Location: Arlington Heights
Posts: 16
JoshSmith is an unknown quantity at this point
Re: Arduino PWM output

Quote:
Originally Posted by WizenedEE View Post
AFAIK we used the "stock" Arduino Wire library on this year's competition robot to communicate the shooter angular velocity with the cRIO.

We just had to use the transaction method of the I2C class.

relevant part of our code:
Code:
UINT8 valuesGotten[2] = {0, 0};
I2CArduino->Transaction(NULL, 0, valuesGotten, 2);
UINT16 fullNumber = (valuesGotten[1] << 8) | valuesGotten[0];
Full code for reading our sensor is attached. I don't currently have access to the arduino side, though.
Interesting. I know for this year I changed the Wire library to run at 38.4khz (what I was told was the digital sidecar's operating frequency for I2C) and just set the Arduino up as a slave device and it worked nicely. But anyways, I will stop myself now before I get too far off-topic. My recommendation on the shields is that if you plan on making more robots than cRIOs, then you should look at a shield as they will be cheaper than spending credits or money on an extra cRIO. Otherwise, if you have a cRIO lying around, just use that (providing you have a backup for your competition bot).

Last edited by JoshSmith : 28-05-2012 at 00:50.