Pages: [1]   Go Down
Author Topic: HOW to use and write a code for H48C Accelerometer  (Read 666 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 6
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 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?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Im sorry Im new to this.... what sketch?
Logged

United States (Texas)
Offline Offline
God Member
*****
Karma: 3
Posts: 525
Arduino socks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You uploaded a sketch to the Arduino. In the setup function, there is a line like this:
Code:
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.
Logged

Pages: [1]   Go Up
Jump to: