|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Delay Help!
We have been working on our autonomous mode and we cant figure out how to make a delay. Our mentor has tried to make his own but the bot wont recive it. Any Suggestions or ideas? Thanks!
Last edited by waiakea2024 : 19-02-2007 at 19:06. |
|
#2
|
||||
|
||||
|
Re: Delay Help!
We are trying to make our arm move and then stop without it hitting the ground and messing up the motor.
|
|
#3
|
|||
|
|||
|
Re: Delay Help!
Quote:
Basically to make a delay, without going into using the onboard timers, is to increment a loop counter every loop and have a test statement which will do something when a certain number of loops has elapsed. Pseudocode: if(arm_is_moving && loops < NEEDED_LOOPS) { loops++; } if(arm_is_moving && loops = NEEDED_LOOPS) { arm_pwm=127; arm_is_moving=0; loops=0; } This is quick and ugly, and it would be more elegant to use the timers or have an encoder. But it'll work in a pinch. I hope this helps. If we see each other at a regional I can help you some more, or post again or use a PM. Ari. |
|
#4
|
||||
|
||||
|
Re: Delay Help!
that didnt work :l thanks for the help though
|
|
#5
|
|||
|
|||
|
Re: Delay Help!
Well if you copied and pasted his code, then you should change the '=' to '=='
![]() Also 'loops' will need to be static ttyl, --buddy |
|
#6
|
||||
|
||||
|
Re: Delay Help!
This is where a limit (either a software one from a shaft encoder or potentiometer) is good. Otherwise, if you really want a delay, let us know (there are several ways of doing this, ranging from crude (loop counting) to good (setting up a timer and interrupt routine to get real-time clocks)
|
|
#7
|
||||
|
||||
|
Re: Delay Help!
well we just downloaded the WPILib and are currently trying to get it to download into our controller. Thanks to all for your advice. We have been trying many different things and we have officially run out of ideas. We are currently waiting for our mentor to see if he has any new ideas.
|
|
#8
|
||||
|
||||
|
Re: Delay Help!
Thanks to everyone for the help and expertice. We finally got it and we are well on our way. Thanks again!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NERDS Delay... | Andy Grady | General Forum | 21 | 14-03-2006 21:52 |
| CMUCam 3 second startup Delay? | Chris_Elston | Programming | 4 | 19-02-2006 09:33 |
| Delay in autonomous mode | SpeakerSilenced | Programming | 1 | 22-02-2005 10:58 |
| Delay | Gal Longin | Programming | 1 | 09-12-2004 10:37 |
| NEED HELP with Delay loop for compressor relay switch | archiver | 2001 | 10 | 24-06-2002 02:11 |