Go Down

Topic: HOW to use and write a code for H48C Accelerometer (Read 765 times) previous topic - next topic

katerina

I hooked up my H48C accelerometer to my arduino board. Ive been having trouble finding a code to just use the accelerometer to measure the tilt in x,y, and z direction and show it neatly on the serial monitor.

if you can help that would be great. thank you.

Ultimately I want to measure the distance and the direction the accelerometer traveled like the accelerometer in foot pods.

thank you

MikMo

http://www.arduino.cc/playground/Main/ParallaxH48C

katerina

so I tried to use the code provided on the website with my arduino board and my H48C accelerometer and when I pulled up my serial monitor I keep getting symbols.

what am I doing wrong?

PaulS

Does the baud rate shown on the Serial Monitor match the baud rate in the sketch?

katerina


weirdo557

"so I tried to use the code provided on the website" <-- that sketch

katerina

i dont think so no.. i get ooooo and uuuuuu's

PaulS

You uploaded a sketch to the Arduino. In the setup function, there is a line like this:
Code: [Select]
Serial.begin(9600);

What number is in the parentheses in your sketch?

At the bottom of the Serial Monitor window, there is a drop down list to allow selecting a baud rate. What value is selected in that window?

If the numbers are not the same, make them the same. If they are the same, post the code you are running.

Go Up