Dual-Axis Accelerometer and BS1
Tech-Man
Posts: 100
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.
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are no Undo buttons in life.
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.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are no Undo buttons in life.
They're used when someone has to convert an analog voltage or current to a digital number.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are no Undo buttons in life.