Go to Post It'd be nice to have some more data to look at, I like data - Aren_Hill [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 08-04-2003, 09:28
odin892 odin892 is offline
Registered User
#0892 (team ASCII: All Students Challenging Intellect and Ingenuity)
 
Join Date: Apr 2003
Location: canal winchester, Ohio
Posts: 11
odin892 is an unknown quantity at this point
gyro code

we used a gyro to balance our arms but the gyro would return to center after about a second or two so we made a pendulum.
here is our code before we took it out. you may need to tweak some variables.

If p3_sw_top = 1 then
If p3_y > 127 then
If balancing_motor_limit_forward = 0 then balancing_motor = p3_y
else

if p3_y < 127 then
if balancing_motor_limit_reverse = 0 then balancing_motor = p3_y

endif
endif
else
If state = 0 then
balancing_motor = 183

If balancing_motor_limit_forward = 1 then balancing_motor = 127

If gyro => 180 then state = 1

else

If state = 1 then
balancing_motor = 63

If balancing_motor_limit_reverse = 1 then balancing_motor = 127

counter = counter + 1
If counter => 30 then
state = 2
endif
else
If state = 2 then balancing_motor = 127

endif
endif
endif
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is your most prefered programming language? Hailfire Programming 156 19-01-2005 21:42
Autonomous code PBoss Programming 7 14-01-2003 15:29
Does your team use the Default code. Jeff McCune General Forum 2 09-01-2003 14:46
Gyro Chip Code archiver 2001 4 24-06-2002 00:57
[white paper] Auto-Balance Gyro Code Brandon Martus Technical Discussion 3 21-06-2001 10:36


All times are GMT -5. The time now is 10:50.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi