View previous topic :: View next topic |
Author |
Message |
kein
Joined: 23 Jul 2007 Posts: 103
|
Thanks |
Posted: Wed Sep 05, 2007 4:15 pm |
|
|
Quote: | If( VinX > 1.63 )
{
Calibrate_Output = (( VinY - 1.63 ) * MA_x ) + 1.65
}else if( VinX == 1.63 )
{
Calibrated_Output = 1.63
}else if( VinX < 1.63 )
{
Calibrated_Output = 1.63 - ((VinX - 1.63 ) * MB_x )
}
*buf_xptr++ = Calibrated_Output;
Calibrated_Output = 0;
/* for the case of "Y" */
VinY = READ ADC Value for Y_Axis
If( VinY > 1.64 )
{
Calibrated_Output = (( VinY - 1.64 ) * MA_y ) + 1.65
}else if( VinY == 1.64)
{
Calibrated_Output = 1.64
}else if( VinY < 1.63 )
{
Calibrated_Output = 1.64 - ((Vin - 1.64 ) * MB_y )
}
*buf_yptr++ = Calibrated_Output;
Calibrated_Output = 0;
} |
Thanks alot. I think the input voltage in the following line should be VinX instead of VinY Code: | If( VinX > 1.63 )
{
Calibrate_Output = (( VinY) - 1.63 ) * MA_x ) + 1.65
} |
and there should be VinY in the following line(typo error)
Code: | else if( VinY < 1.63 )
{
Calibrated_Output = 1.64 - ((Vin - 1.64 ) * MB_y )
} |
thanks |
|
|
collegeman Guest
|
pulling up accelerometer using pic16f877a |
Posted: Fri May 01, 2009 5:38 pm |
|
|
My fellow students and I are trying to program a pic16f877a controller to control a rc car. We are using an accelerometer and want to integrate the signal to get the distance traveled. We are having a hard time trying to figure out how to get the information from my accelerometer to be able to integrate it. can any one help us with this. |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Sun May 03, 2009 10:52 am |
|
|
To understand, if you can get a meaningful distance measurement, I suggest to to determine the expectable error of your acceleration value, put in the intended duration of measurement after zeroing the position and calculate the position offset.
I fear, you won't go far with it. |
|
|
nachum
Joined: 23 Aug 2009 Posts: 3
|
Re: Converting accelerometer adc values to Gs |
Posted: Sun Aug 23, 2009 9:41 am |
|
|
hi
You have the code to reading from ADXL330 ? |
|
|
vinniewryan
Joined: 29 Jul 2009 Posts: 154 Location: at work
|
|
Posted: Sun Aug 23, 2009 1:22 pm |
|
|
Wow this is all great help to me as well! I'm working with an accelerometer right now as well, though I do have one question in regard to wiring it to the PIC: will I need any extra components in order to get the accelerometer to send signal to the PIC? All I want to do is have the pic read the x, y, and z inputs as decimal values. I've looked it up but everything I've found is specific to some other circuit and I don't need anything else. Accelerometer, PIC, battery.
Thanks! |
|
|
nachum
Joined: 23 Aug 2009 Posts: 3
|
adxl330 |
Posted: Sun Aug 23, 2009 2:04 pm |
|
|
hi
You read the data from the pic...to computer
You have electric diagram of the circuit ?
u can send me the code that wrote or what you have ?
nachum.adi@gmail.com |
|
|
nachum
Joined: 23 Aug 2009 Posts: 3
|
Re: pulling up accelerometer using pic16f877a |
Posted: Sun Sep 13, 2009 12:01 pm |
|
|
hi
You read the data from the pic...to computer
You have electric diagram of the circuit ?
u can send me the code that wrote or what you have ?
nachum.adi@gmail.com |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
avneesh
Joined: 27 May 2010 Posts: 1
|
Adxl335 |
Posted: Thu May 27, 2010 5:33 pm |
|
|
Hi
I have a similar problem with using the adxl335. I read the values using my 12 bit ADC in the aduc7020. The result is a 12bit binary, which I can convert to decimal, but I want to know how to get the values to voltage.
when the adx335 is flat on the table the values of x=2773 y=2857 z=1192
note: these value are decimal
How do I convert these values to voltage... the math to do this what I need.
Thanks.
I'm new to this so any help will be appreciated.
Also I would really appreciate a quick back, I need to complete this work very soon.
+++++++++++++++++++++++++
The ADuC7020 micro is off topic.
Please ask on a ADuC7020 forum.
-- Forum Moderator
+++++++++++++++++++++++++ |
|
|
|