Thread: Arduino + CRIO
View Single Post
  #6   Spotlight this post!  
Unread 05-08-2014, 14:02
RyanShoff RyanShoff is offline
Registered User
FRC #4143 (Mars Wars)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2012
Location: Metamora, IL
Posts: 147
RyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to behold
Re: Arduino + CRIO

https://github.com/FRC-Team-4143/swerveneopixel

This sketch controls Adafruit neopixel leds over i2c. I2c is echoed over serial for debugging.

Crio code (in c++) is something like:
Code:
m_i2c = DigitalModule::GetInstance(1)->GetI2C(0x04 << 1);
RobotMap::m_i2c->Write(0x0, 50);
The first 0x0 is the command. The 50 is a parameter to the command in the sketch.

The i2c address is 0x4, but you have to shift it left on the Crio to write. That is the tricky part.
__________________
Ryan Shoff
4143 Mars/Wars
CheapGears.com

Last edited by RyanShoff : 05-08-2014 at 14:11. Reason: changed parameter to not get confused with address
Reply With Quote