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
User Comments
Add a Comment
Sharing is good. So if you have a comment about this entry please feel free to share. The Comments might be reviewed by our Staff and might require approval before being posted. Questions posted will not be answered, please submit a ticket for support requests.
Fullname:
Email: (Optional)
Comments:
Login
[Lost Password]
Email:
Password:
Remember Me:
Search
-- Entire Support Site --
Knowledgebase
Downloads
Troubleshooter
Article Options
Add Comment
Print Article
PDF Version
Email Article
Add to Favorites
Home
|
Register
|
Submit a Ticket
|
Knowledgebase
|
Troubleshooter
|
News
|
Downloads
Language:
English (U.S.)