Go to Post The best moments of our lives fall in two categories: those that did happen and those that did not. - Jnadke [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 02-02-2009, 12:44
oddjob oddjob is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Earth
Posts: 118
oddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to behold
Accelerometer class - isn't reading zero at rest?

Do we have a bad KoP board or the code is wrong or missing some setup?

Code:
...

// Declare variables for the 3 axis accelerometer (2 channels wired)
Accelerometer *m_accelerometerX;
Accelerometer *m_accelerometerY;

...

// create accelerometers
m_accelerometerX = new Accelerometer(2);
m_accelerometerY = new Accelerometer(3);

...

//m_accelerometerX->SetSensitivity(0.0);
//m_accelerometerY->SetSensitivity(0.0);
//m_accelerometerX->SetZero(0.0);
//m_accelerometerY->SetZero(0.0);

...

accX = m_accelerometerX->GetAcceleration();
accY = m_accelerometerY->GetAcceleration();
...
The accX and accY values are about 1.5 each when the board is at rest. Do we need to use SetZero? I tried putting in 1.5 for the value and then accX went to an entirely different non zero value, -2.5 or something like that. Can I just use AnalogChannel and do the scaling in the code?
Reply With Quote
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Floating point math zero flippo Programming 3 09-02-2007 09:00
OI and analog: Zero value Astronouth7303 Programming 1 02-02-2004 16:00
Community Zero archiver 2001 1 24-06-2002 04:08
How about zero qualifying points? archiver 2000 0 23-06-2002 22:01
Zero Hour archiver 2000 4 23-06-2002 21:59


All times are GMT -5. The time now is 17:31.

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