View Single Post
  #2   Spotlight this post!  
Unread 13-02-2013, 06:58
kenfox kenfox is offline
Registered User
FRC #3322 (Eagle Imperium)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Ann Arbor, MI
Posts: 51
kenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of light
Re: Accelerometer Code Making Robot Stop Moving

Quote:
Originally Posted by progal View Post
whenever we [instantiate] the accelerometer ... our robot components stop working completely.

Code:
adxl(5, 6, 7, 8, ADXL345_SPI::kRange_2G)
The constructor for ADXL345_SPI takes the digital IO module as the first parameter and has a default kRange_2G value for the 6th parameter. You are asking it to use a non-existant module #5 which probably causes the robot code to crash. Do you see an error message about using a module out of range?

If you only have one digital IO module in the cRIO, it will be module #1.

Does the following code work better?

Code:
adxl(1, 5, 6, 7, 8)
Reply With Quote