09 Sep 2010 
Support Center » Knowledgebase » Using Tilt Sensor
 Using Tilt Sensor
Solution If the tilt sensor is connected to A/D port 0, then you can use this kind of code for automatic standup.

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

IF A < 30 THEN GOTO tilt_low
IF A > 200 THEN GOTO tilt_high

RETURN
tilt_low:
A = AD(0)
'IF A < 30 THEN GOTO forward_standup
IF A < 30 THEN GOTO backward_standup
RETURN
tilt_high:
A = AD(0)
'IF A > 200 THEN GOTO backward_standup
IF A > 200 THEN GOTO forward_standup
RETURN


backward_standup:
.....
goto main

forward_standup:
.....
goto main





Article Details
Article ID: 4
Created On: 05 Apr 2006 02:55 PM

 This answer was helpful  This answer was not helpful

 Login [Lost Password] 
Email:
Password:
Remember Me:
 
 Search
 Article Options
Home | Register | Submit a Ticket | Knowledgebase | Troubleshooter | News | Downloads
Language: