getting values of 6500 for xy axis data with memsic accelerometer. The pdf that i have says that I should be getting value in the area of 2500, any help?
That explains it; the BS2p is much faster than the BS2 (for which the demo was written) so you have to scale the input pulse width differently.· In the original progam, you should have a line that looks like this:
· xRaw = xRaw * 2
You need to change that to:
· xRaw = xRaw */ $0CC
The */ operator lets us multiply by fractional values, and $0CC represents 0.8 for the BS2p
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Jon Williams Applications Engineer, Parallax
ok so I realized that the code I'm using doesn't have that line of code. I did find the code for g force that has that line in it but, the pdf that I have has a simple x/y axis program.I'm still trying to understand the language for the g-force program. I understand about bringing the xraw var to scale, but the only var in this program are x and y. any help would be great
I have a program for the Memsic which I will share with you if you think that will help.· The program displays the following data when running:
X Axis:· 5024·· 0.016 g··· 0°
Y Axis:· 5006·· 0.000 g··· 0°
The first number in each line is the true raw pulse width in us, the second the g-force and the third the degrees of tilt from a horizontal plane.· The program contains a conditional compilation that lets the program run on any Stamp without having to·change·the program.· A perfect 50% duty cycle would display 5000 and 5000, so you can see the duty cycle is very, very close to 50%.
The program has been modified so that if the current reading is the same as the previous reading, then it skips the display and goes back for another reading.· It has been further modified to display the reading every 50 program cycles, regardless of whether the readings are the same or not.
If you would like the program just let me know and I will post it.
I've attached a version of that program that will work with any BS2 module -- it adds conditional statements that scale the input based on the module type.· Since this program scales the input to 1 microsecond units, it's a little easier to see the g-force formula implemented.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Jon Williams Applications Engineer, Parallax
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
· xRaw = xRaw * 2
You need to change that to:
· xRaw = xRaw */ $0CC
The */ operator lets us multiply by fractional values, and $0CC represents 0.8 for the BS2p
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
X Axis:· 5024·· 0.016 g··· 0°
Y Axis:· 5006·· 0.000 g··· 0°
The first number in each line is the true raw pulse width in us, the second the g-force and the third the degrees of tilt from a horizontal plane.· The program contains a conditional compilation that lets the program run on any Stamp without having to·change·the program.· A perfect 50% duty cycle would display 5000 and 5000, so you can see the duty cycle is very, very close to 50%.
The program has been modified so that if the current reading is the same as the previous reading, then it skips the display and goes back for another reading.· It has been further modified to display the reading every 50 program cycles, regardless of whether the readings are the same or not.
If you would like the program just let me know and I will post it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax