Shop OBEX P1 Docs P2 Docs Learn Events
H48C Accelerometer Code Issue — Parallax Forums

H48C Accelerometer Code Issue

John BoardJohn Board Posts: 371
edited 2012-06-01 15:29 in Propeller 1
G'day,

I've been playing around with the H84C accelerometer lately, and I've come to a bit of a dead end in my code, I was wondering if any could help.

The module appeared to be working using the code from this page:
http://forums.parallax.com/showthread.php?88214-Propeller-Object-Hitachi-H48C-Tri-Axis-Accelerometer-Module&p=605279#post605279

I've attached my code so you can see what I'm doing.

Thanks in advance!

-John

Comments

  • cessnapilotcessnapilot Posts: 182
    edited 2012-05-31 22:55
    Hi John,

    As an alternative, you can find a synchronuos driver for H48C on OBEX. Up till now none of the users complained.
    There is a General MEMS sensor model on OBEX, too. Using it the accuracy of the H48C sensor can be improved
    hundrefold, at least. Not to mention the 3-4 times improved precision. The General MEMS Sensor model object can
    be used to boost performance for all 3D (accelero, gyro, magnetic) sensors of Parallax by magnitudes.

    Istvan
  • John BoardJohn Board Posts: 371
    edited 2012-06-01 01:10
    Thanks! I was able to find an object that suited me.

    I have made a python program to display the values in a "graph like" fassion, I'll post it along with my propeller code for anyone else who has a H48C who wants to give it a go. (The python program will be in a .exe form).

    -John
  • John BoardJohn Board Posts: 371
    edited 2012-06-01 15:29
    G'day,

    As I promised, I've attached a .zip of some code that I've written up along with a python program to display the data on your computer screen.

    I haven't however made the program a .exe - So you will need python, pygame, and pySerial to run this program.

    Just open the Demo.spin, download the program, and away you go! The pins for the H48C are defined as constants at the top of "Demo.spin", otherwise the wiring is as per normal. Once you have downloaded the code, just run the acc.py file to get the program underway - Note! Keep "CTRL+ALT+DEL" handy....

    Here's a picture of the program in action:

    accelerometer.PNG


    -John
    640 x 480 - 12K
Sign In or Register to comment.