View Single Post
  #1   Spotlight this post!  
Unread 12-02-2013, 18:41
progal's Avatar
progal progal is offline
Programmer
AKA: Shelby
FRC #0384 (Sparky)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Glen Allen
Posts: 15
progal is an unknown quantity at this point
Accelerometer Code Making Robot Stop Moving

Hey, apologies if this is an already answered question. I couldn't find anything on the topic.
The problem that we're having is whenever we state the accelerometer (not even doing anything with it, but just instantiating it), our robot components stop working completely. The robot won't move, et cetera.

Also, we don't know how to get the values from the gyro once in teleop, or rather the method to use to get the values from the accelerometer.

This is our code:
Code:
class RobotDemo : public SimpleRobot
{
        RobotDrive myRobot; // robot drive system
	Joystick stick1, stick2; // only joystick
	ADXL345_SPI adxl;
Code:
public:
	RobotDemo(void):
		myRobot(2, 1),	// these must be initialized in the same order
		stick1(1),		// as they are declared above.
		stick2(2),
		adxl(5, 6, 7, 8, ADXL345_SPI::kRange_2G)
Thanks in advance!
__________________

C++ Programmer
Reply With Quote