by viper1 » Wed May 23, 2007 10:16 pm
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
'===============================================