Go to Post While science and technology can solve difficult problems, it is people and interaction that make it all work. - DonRotolo [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 11-04-2009, 17:18
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,754
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

From what I understand, you want a button press to trigger an action of turning on the motor for x seconds. It will stay there until the button is released, then a new action will run to negate the other movement. The reason I review is that a short click and release will then go through both actions with nothing in between? No canceling the first movement? You also need to decide what happens when the driver clicks and releases multiple times rapidly -- one movement or N movements, one for each click.

If my understanding is reasonably close to what you want, look up LabVIEW examples for state machines. I'll name the motor positions home and engaged. You state machine has states of Home, Engaging, Engaged, Disengaging.

From home, a button press moves to Engaging. Time moves from Engaging to Engaging. A button release or pending one moved from Engaged to Disengaging. Time moves from DisEngaging to Home.

I'd set up a periodic task that runs the motor for time and contains the state variable. You can read the joystick button state in that loop at a given rate, or you can leave it in your teleop code and update a local or global that indicates the position of the button, up or down.

Hopefully this helps you think about how to approach the problem. I'll leave the rest to you.
Greg McKaskle
Reply With Quote
 


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:47.

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