Go to Post I'll do my best, but I'm this --><-- close to telling our drivers they're NASCAR styling it this season..."Sorry boys and girls, left turns only!" - Mr. Lim [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 21-01-2013, 14:32
Team3763 Adam Team3763 Adam is offline
Lead Programmer
FRC #3763 (4H WildCards)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: North Carolina
Posts: 157
Team3763 Adam can only hope to improve
One Motor Autonomou

Just making a simple code where a single motor with a jaguar will run for 5 seconds then stop.

What code would I use to execute this? I get to calling up the code then getting the output, but I can't add a time and inputs for power.
Reply With Quote
  #2   Spotlight this post!  
Unread 21-01-2013, 14:42
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,713
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: One Motor Autonomou

For a timed action you can put the code in Periodic Tasks.vi.
With a state-machine you could put code in Teleop.vi
There are lots of different ways to do something like this.

Here's an example that could be used in Teleop.vi
You'd add your Set Motor in the True case, and add another case outside to the right that used Time to do it? as a flag to stop the motor.



This example for Periodic Tasks.vi would just need the two sequence frames that do the Motor sets to start, then stop the motor.
Ignore the Servo stuff. They were demonstrating extra actions.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 21-01-2013 at 14:55.
Reply With Quote
  #3   Spotlight this post!  
Unread 21-01-2013, 18:10
Team3763 Adam Team3763 Adam is offline
Lead Programmer
FRC #3763 (4H WildCards)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: North Carolina
Posts: 157
Team3763 Adam can only hope to improve
Re: One Motor Autonomous

What about in Autonomous period? With two motors you can attach a timer to have a motor running for x amount of seconds, but you can't attach the timer to a One motor item.

WPI Robotics Library -> Robot Drive -> Advanced is the location of said timer.
Reply With Quote
  #4   Spotlight this post!  
Unread 21-01-2013, 18:35
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,713
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: One Motor Autonomou

Here's an Autonomous Independent.vi example.
Just replace Tank Drive with Set Motor, Left and Right Motors refnum Get with a Motor refnum get, and you don't need the Safety Config.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
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


All times are GMT -5. The time now is 08: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