Go to Post A Strong FRC Team Should... have a clear vision and an understanding of how to achieve it within their means. - jwfoss [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-01-2011, 19:49
ElliotCourant's Avatar
ElliotCourant ElliotCourant is offline
Elliot Courant
AKA: Elliot Courant
FRC #3038 (ICE Robotics)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Minnesota
Posts: 19
ElliotCourant is an unknown quantity at this point
Accelerometer

So I'm trying to implement the accelerometer, and i get several errors.

Code:
RobotDemo(void):
		myRobot(1, 2, 3, 4),	// these must be initialized in the same order
		leftstick(1),		// as they are declared above.
		rightstick(2),    	// as they are declared above.
		gyro(1,1),
		acc(I2C)
{
and it gives me this

Code:
C:/WindRiver/workspace/Final/MyRobot.cpp:34: error: expected primary-expression before ')' token
How do I implement the accelerometer?
__________________
"Error, Cannot Find Back-End!" -WindRiver C++ Error
"If you aren't getting any errors while you are programming, then you are doing something wrong." -Elliot Courant
Reply With Quote
  #2   Spotlight this post!  
Unread 31-01-2011, 20:17
ElliotCourant's Avatar
ElliotCourant ElliotCourant is offline
Elliot Courant
AKA: Elliot Courant
FRC #3038 (ICE Robotics)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Minnesota
Posts: 19
ElliotCourant is an unknown quantity at this point
Re: Accelerometer

bump
__________________
"Error, Cannot Find Back-End!" -WindRiver C++ Error
"If you aren't getting any errors while you are programming, then you are doing something wrong." -Elliot Courant
Reply With Quote
  #3   Spotlight this post!  
Unread 31-01-2011, 22:11
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Accelerometer

Be patient. It was less than a half hour before your "bump".

Have you looked at the documentation for the ADXL345_I2C class? Is there anything you don't understand about it?
Reply With Quote
  #4   Spotlight this post!  
Unread 01-02-2011, 14:42
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: Accelerometer

Quote:
Originally Posted by ElliotCourant View Post
So I'm trying to implement the accelerometer, and i get several errors.

Code:
RobotDemo(void):
		myRobot(1, 2, 3, 4),	// these must be initialized in the same order
		leftstick(1),		// as they are declared above.
		rightstick(2),    	// as they are declared above.
		gyro(1,1),
		acc(I2C)
{
and it gives me this

Code:
C:/WindRiver/workspace/Final/MyRobot.cpp:34: error: expected primary-expression before ')' token
How do I implement the accelerometer?
Which line is 34? What is I2C? A constant? A macro? Full source code would be helpful.
Reply With Quote
  #5   Spotlight this post!  
Unread 01-02-2011, 18:03
ElliotCourant's Avatar
ElliotCourant ElliotCourant is offline
Elliot Courant
AKA: Elliot Courant
FRC #3038 (ICE Robotics)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Minnesota
Posts: 19
ElliotCourant is an unknown quantity at this point
Re: Accelerometer

Quote:
Originally Posted by basicxman View Post
Which line is 34? What is I2C? A constant? A macro? Full source code would be helpful.

line 34 is "acc(I2C)"
Click image for larger version

Name:	Capture.PNG
Views:	25
Size:	6.4 KB
ID:	9918 That is a screenshot of just that part.


And yes I have looked at the documentation but it didn't really help me that much. It just told me that it needed a slot and a PID source. But because the accelerometer is connected to the I2C section I can't get it to work.
__________________
"Error, Cannot Find Back-End!" -WindRiver C++ Error
"If you aren't getting any errors while you are programming, then you are doing something wrong." -Elliot Courant
Reply With Quote
  #6   Spotlight this post!  
Unread 01-02-2011, 18:28
ElliotCourant's Avatar
ElliotCourant ElliotCourant is offline
Elliot Courant
AKA: Elliot Courant
FRC #3038 (ICE Robotics)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Minnesota
Posts: 19
ElliotCourant is an unknown quantity at this point
Re: Accelerometer

Here is the deceleration of "acc"

Click image for larger version

Name:	Capture.PNG
Views:	34
Size:	9.6 KB
ID:	9919

But it doesn't give me any errors there
__________________
"Error, Cannot Find Back-End!" -WindRiver C++ Error
"If you aren't getting any errors while you are programming, then you are doing something wrong." -Elliot Courant
Reply With Quote
  #7   Spotlight this post!  
Unread 01-02-2011, 21:58
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: Accelerometer

Quote:
Originally Posted by ElliotCourant View Post
Here is the deceleration of "acc"

Attachment 9919

But it doesn't give me any errors there
Are you using the ADXL345? In which case you need to use the ADXL345_I2C class, not the Accelerometer class.

Again, what is I2C? A macro? A constant?
Reply With Quote
  #8   Spotlight this post!  
Unread 01-02-2011, 22:10
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Accelerometer

Quote:
Originally Posted by basicxman View Post
Are you using the ADXL345? In which case you need to use the ADXL345_I2C class, not the Accelerometer class.
Quite correct.

Quote:
Again, what is I2C? A macro? A constant?
In the code Elliot posted, I2C is undefined. That's why the compiler choked on it.
Reply With Quote
  #9   Spotlight this post!  
Unread 01-02-2011, 22:12
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: Accelerometer

Quote:
Originally Posted by Alan Anderson View Post
In the code Elliot posted, I2C is undefined. That's why the compiler choked on it.
Elliot did not post his entire source code, there could be a constant or preprocessor definition above the class definition.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:09.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi