Go to Post FIRST isn't chaotic; the rest of the world just moves in slow motion! - StephLee [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 10-03-2013, 01:34
F22Rapture's Avatar
F22Rapture F22Rapture is offline
College Student, Mentor
AKA: Daniel A
FRC #3737 (4H Rotoraptors)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Goldsboro, NC
Posts: 476
F22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant future
Best way to implement a timed action

We need to have our frisbee injector (which is an arm attached to a window motor) actuate forward for exactly X milliseconds, and then retract backwards until it triggers a limit switch. I know there are a couple different ways to do this but I was wondering how it would be best to do so.

1. Spawn off a second thread, set to actuate forward, Timer.delay() for X milliseconds, actuate backward, and then return isFinished() as true when the microswitch is triggered. I could have sworn I'd seen a team do it this way, but then I came across some comments saying that creating a Thread inside a command is a bad idea, etc.

2. Create 2 commands (which I would prefer not to do), the first of which is timed using isTimedOut(), the second of which triggers via the microswitch, and call them sequentially in a command group

3. Ways I haven't thought of

Thoughts?
__________________
Research is what I’m doing when I don’t know what I’m doing.
- Wernher von Braun
Attending: Raleigh NC Regional
 


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


All times are GMT -5. The time now is 22:38.

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