Go to Post Save the frustration for build season. :p - Brian C [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-04-2009, 16:47
BurtGummer BurtGummer is offline
Electrical/Mechanical/Programming
FRC #3020
Team Role: Engineer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Southern CA
Posts: 89
BurtGummer will become famous soon enoughBurtGummer will become famous soon enough
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.
__________________
I'm a mentor looking for a home in Southern California! I know Java, C++, electrical and mechanical.

Need Java or C++ help? Send me a PM!
Reply With Quote
  #2   Spotlight this post!  
Unread 13-04-2009, 03:50
BurtGummer BurtGummer is offline
Electrical/Mechanical/Programming
FRC #3020
Team Role: Engineer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Southern CA
Posts: 89
BurtGummer will become famous soon enoughBurtGummer will become famous soon enough
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.
__________________
I'm a mentor looking for a home in Southern California! I know Java, C++, electrical and mechanical.

Need Java or C++ help? Send me a PM!
Reply With Quote
  #3   Spotlight this post!  
Unread 13-04-2009, 07:44
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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
Reply With Quote
Reply


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
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


All times are GMT -5. The time now is 21:36.

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