Shop OBEX P1 Docs P2 Docs Learn Events
Dual-Axis Accelerometer and BS1 — Parallax Forums

Dual-Axis Accelerometer and BS1

Tech-ManTech-Man Posts: 100
edited 2008-03-20 20:23 in BASIC Stamp
I have a Dual-Axis Accelerometer like this http://www.usfirst.org/uploadedFiles/Community/FRC/FRC_Documents_and_Updates/2008_Assets/Manual/2008_Sensor_Manual.pdf (it’s on page 3)
I found some code for the Parallax DAA and figured that it would work about the same for mine, but then I noticed that it was for a BS2 and some of it won’t work on a BS1. So I modified it to the best of my knowledge and got it to download but I don’t think it’s working right. Because the X/Y stays at zero and only sometimes dose it move up or down. I know my DAA works because the values flex when cheeked with a multi meter.
·
This is the BS2 code I found
' SimpleTilt.bs2
' Measure room temperature tilt.
'{$STAMP BS2}
'{$PBASIC 2.5}
·
x VAR Word
y VAR Word
DO
PULSIN 6, 1, x
PULSIN 7, 1, y
DEBUG CLS, ? X, ? Y
Loop
And here is the code I thought I could make work
' {$STAMP BS1}
' {$PBASIC 1.0}
·
main:
SYMBOL· x···· = B2
SYMBOL· y···· = B1
PULSIN 6, 1, x
PULSIN 7, 1, y
DEBUG CLS,· x,· y
GOTO main
·
Basically all I want to do is have it debug the X/Y values. Then if I can get that working, I have this two wheeled robot base and I want to make a balancing robot. Is there a good site explaining a robot like this on a BS1 platform.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are no Undo buttons in life.

Comments

  • Tech-ManTech-Man Posts: 100
    edited 2008-03-20 15:20
    So i have yet to figure this out, any one have any ideas even if its not exactly what i need. Thanks,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are no Undo buttons in life.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-20 15:29
    The Parallax DAA and the one you have are completely different. The Parallax one outputs a pulse for X and Y that varies in width depending on the acceleration along that axis. The one you have produces an analog voltage between roughly 2.5 and 3.5V depending on the acceleration. You need an analog to digital converter.

    Check this page: www.parallax.com/tabid/440/Default.aspx

    There's a Basic Stamp 1 Application Notes link. The 2nd chapter in that shows how to use an ADC0831 analog to digital converter with a BS1.
  • Tech-ManTech-Man Posts: 100
    edited 2008-03-20 19:56
    O I feel so dumb I should have read up on this stuff instead of rushing into things. I remember reading about ADC's, are they used often in circuits? I mean I have boxes of old circuit boards down stairs maybe I could go find one. If not ill put it on my list of things to order in the near future.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are no Undo buttons in life.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-20 19:59
    Parallax carries them as well as the usual suppliers (Jameco, Mouser, DigiKey, etc.)

    They're used when someone has to convert an analog voltage or current to a digital number.
  • Tech-ManTech-Man Posts: 100
    edited 2008-03-20 20:23
    Well I’ll check to see if I have any first, sounds like something that might be on an old computer modem, or in a VCR. Well thanks tough I can't do much till I find one of them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are no Undo buttons in life.
Sign In or Register to comment.