Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

ACCELEROMETER

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
16 postsPage 2 of 21, 2
16 postsPage 2 of 21, 2

Accelerometer

Post by viper1 » Wed May 23, 2007 10:16 pm

Post by viper1
Wed May 23, 2007 10:16 pm

I figured it out: For any other newbys that might be haveing similar questions , heres the code that works great using an ADXL320 Accelerometer. Im using A/D port #7

'===============================================
robot_tilt:
A = AD(7)
IF A > 250 THEN RETURN

IF A <100> 160 THEN GOTO tilt_high

RETURN
tilt_low:
A = AD(7)
'IF A < 30 THEN GOTO forward_standup
IF A < 100 THEN GOTO backward_standup
RETURN
tilt_high:
A = AD(7)
'IF A > 200 THEN GOTO backward_standup
IF A > 160 THEN GOTO forward_standup
RETURN
'===============================================
I figured it out: For any other newbys that might be haveing similar questions , heres the code that works great using an ADXL320 Accelerometer. Im using A/D port #7

'===============================================
robot_tilt:
A = AD(7)
IF A > 250 THEN RETURN

IF A <100> 160 THEN GOTO tilt_high

RETURN
tilt_low:
A = AD(7)
'IF A < 30 THEN GOTO forward_standup
IF A < 100 THEN GOTO backward_standup
RETURN
tilt_high:
A = AD(7)
'IF A > 200 THEN GOTO backward_standup
IF A > 160 THEN GOTO forward_standup
RETURN
'===============================================
viper1
Savvy Roboteer
Savvy Roboteer
Posts: 37
Joined: Thu May 10, 2007 2:55 pm

Previous
16 postsPage 2 of 21, 2
16 postsPage 2 of 21, 2