Gramps
Senior Member
Lance Benson said to Gramps:
As it turned out, I received the non-i2c version of this the day before you posted:
Today I wired it up and scotch-taped it to a pencil. It works reliably reading the "Z" axis with this code:
Code:
' 08accel_xl335 ' accelerometer
#picaxe 08M2 ' 20M2
#terminal 4800
do
readadc10 C.1,w1 ' read "Z" axis of XL335 accelerometer
if w1 < 380 then ' acceleration towards a strike
sertxd(#w1," ")
pause 200 ' reduce/eliminate double reports
endif
pause 5
loop
As we move the ADXL335-3, the numbers change in the terminal. The range is 270 to 370.
My question is how to code this sensor to a servo output so the servo would track the movement of the accelerometer?
Would you have to map the numbers of the accelerometer or is there a simple command?
As it turned out, I received the non-i2c version of this the day before you posted:
Today I wired it up and scotch-taped it to a pencil. It works reliably reading the "Z" axis with this code:
Code:
' 08accel_xl335 ' accelerometer
#picaxe 08M2 ' 20M2
#terminal 4800
do
readadc10 C.1,w1 ' read "Z" axis of XL335 accelerometer
if w1 < 380 then ' acceleration towards a strike
sertxd(#w1," ")
pause 200 ' reduce/eliminate double reports
endif
pause 5
loop
As we move the ADXL335-3, the numbers change in the terminal. The range is 270 to 370.
My question is how to code this sensor to a servo output so the servo would track the movement of the accelerometer?
Would you have to map the numbers of the accelerometer or is there a simple command?