Log in

View Full Version : Connect Arduino to cRIO


Chiller
13-03-2014, 11:38
How would I go about wiring my Arduino uno to the Digital Sidecar for use as a slave through I2C?

I tried just wiring up pins A4 & A5 to the SDA ans SDL lines but that did not work...

I was reading somewhere that those two lines need pullup resistors, is this true and will this make a difference?

Thanks, Chiller!

Danny Diaz
13-03-2014, 11:49
How would I go about wiring my Arduino uno to the Digital Sidecar for use as a slave through I2C?

Grab an NXT cable and cut it in half. Wire the SCL / SDA pins into the cable for the Clock / Data lines, respectively (pinout (http://salviusrobot.blogspot.com/2012/04/lego-nxt-wire-pinout.html)). Connect the NXT plug into the gray NXT-like plug on the Digital Sidecar. Huzzah!

-Danny

SteveGarward
13-03-2014, 12:08
Use ground as well to give the sidecar/robot a common ground with the Arduino.

Also, in your Arduino code, you will need to set the clock speed for the I2C (Wire) library to the same as the cRIO/sidecar. Add the following line to your code, PRIOR to the wire.h include:
#define TWI_FREQ 38400L

Chiller
13-03-2014, 13:00
Use ground as well to give the sidecar/robot a common ground with the Arduino.

Also, in your Arduino code, you will need to set the clock speed for the I2C (Wire) library to the same as the cRIO/sidecar. Add the following line to your code, PRIOR to the wire.h include:
#define TWI_FREQ 38400L

Would you happen to know if I need those pullup resistors?

SteveGarward
13-03-2014, 13:33
There are internal pullups on these lines in the sidecar, so you do not need to add additional pullups. Just connect the sidecar outputs directly to the Arduino A4/A5.