View Single Post
  #1   Spotlight this post!  
Unread 06-03-2010, 21:46
nedrobotics's Avatar
nedrobotics nedrobotics is offline
Scott Jewell - Team 1584
AKA: Fleet Admiral Jewell
FRC #1584 (Nederland Pirates)
Team Role: Mentor
 
Join Date: Dec 2009
Rookie Year: 2004
Location: Nederland, CO, USA
Posts: 5
nedrobotics is an unknown quantity at this point
C++ I2C Accelerometer - Can't send power

We have recently installed the 2010 Accelerometer (ADXL345) on our robot and have the new ADXL345 class code in Windriver. But whenever we try to read values from it, they all read 0. We believe this is because according to the FIRST Sensor Manual, “The ADXL345 starts in a power saving mode. You must turn it on by writing 0x08 to POWER_CTL (0X2D) before it will do anything interesting.”

We are not sure how to write any values to the I2C class to turn on the accelerometer. We tried accessing the write function from the I2C class through the ADXL345_I2C class and using it within the main robot class, but then the code would not compile. What syntax would we use to write the value "0x08" to the POWER_CTL and turn on the accelerometer?
Reply With Quote