|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Momentary On/Off
Honestly, I kind of understand how you described it, but I have no idea how to di it in LabView. Seriously, I really don't understand it, and don't have the time to learn it right now. Any links maybe?
|
|
#2
|
||||
|
||||
|
Re: Momentary On/Off
can you better describe the process of buttons pressed and movements for us?
what i'm getting is this: your T time variable = 10 seconds button A is held for T+5 seconds Motor B is moved forward for T seconds and then stops [even though button A is still pressed] button A is released Motor B is moved reverse for T seconds does this sound right? if Button A is released after less than T seconds, what happens? does the motor continue for the rest of the T time and then automatically reverse or does the motor reverse immediately when the button is released? |
|
#3
|
|||
|
|||
|
Re: Momentary On/Off
Preferably I'd want it to reverse and reset to it's home position if the button is released too soon. However, the motor will only run for about .5 seconds, so it shouldn't be too difficult to keep it pressed for at least 5 seconds. But as far as you described it, that's correct.
|
|
#4
|
|||
|
|||
|
Re: Momentary On/Off
Ok, I wrote a bunch of code in the past several hours.
I scrapped the original idea, and rather went with something slightly different. 1. Button is TAPPED 2. Motor Turns on for X seconds, for V speed 3. Motor reverses, at V/4 for 4X seconds 4. Motor is back at home position To do this I used 2 case structures in my TeleOp Code. I used a joystick get button for, well, getting the button, and wired each joysticks button 1(trigger) to the case. When button is pressed, it is True, in turn running the code in that case. The code, how I have it written in the case, will take about 1.25 seconds to complete what I want it to do. However, I am concerned that the trigger, button 1, will have to be held for 1.25 seconds for the code to complete, insteads of just having to tap it to run the entire code. I haven't done anything like this, and obviously I can't test it on the robot. So, will the code finish if I only tap the trigger which activates it? BTW, I am using Watchdog DELAY&FEED to do the timing. That is alright to do, right? I just finally understood autonomous coding today, so I applied the watchdog timing concept to this. |
|
#5
|
|||
|
|||
|
Re: Momentary On/Off
You don't want to delay your teleop.
Move your code from the teleop loop into a parallel loop, like the one for periodic tasks. That way your teleop can return and be called again with more joystick info. I'd just move the joystick stuff to the parallel loop too. If it is in a parallel loop, you can use delay or delay and feed no problem. Greg McKaskle |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Woot-off | Greg Needel | Chit-Chat | 7 | 05-10-2007 14:25 |
| Woot-Off | JohnBoucher | Chit-Chat | 46 | 23-03-2007 22:15 |
| 437 Showing Off it's Off Season | NextPerception | Robot Showcase | 7 | 06-02-2007 19:03 |
| Momentary Switch Programming | silv940 | Programming | 3 | 24-05-2006 02:19 |
| hanging off off other robots that are hanging off the horiz bar | Andrew Dahl | Rules/Strategy | 15 | 12-01-2004 19:14 |