Go to Post IT ISN'T THE STUDENT'S JOB TO DISCIPLINE OTHER STUDENTS. That's why God invented mentors. Let them do their jobs. - Collin Fultz [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 10-02-2009, 22:39
Luke Pike's Avatar
Luke Pike Luke Pike is offline
Programmer
FRC #1501 (THRUST)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Huntington
Posts: 114
Luke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to all
Re: Limit Switches

I can't see the other cases, so I can't really debug your code. So instead, I wrote an example that should work. It's set up with it's own while loop, so you can add it anywhere outside the Basic Robot Main vi. Feel free to put parts of it somewhere else, or incorporate it with your RobotData.

It's basically a state machine. In the first state you can move the motor both left and right until you hit a limit switch. Then you're limited to going the other direction or stopping if you go the other way. Once you hit the other limit switch, it's vice versa.

I hope this helps you. Check out the lvmastery video on State Machines. I found it to be very helpful. Good luck!
Attached Files
File Type: vi limit switch state machine.vi (57.7 KB, 120 views)
__________________
Twitter Profile

Last edited by Luke Pike : 11-02-2009 at 11:46. Reason: Forgot the 's on it
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
Limit switches(in C++) beefy1 Programming 3 24-12-2008 15:27
Limit Switches ChrisR_522 Programming 2 25-01-2008 08:04
limit switches stephenthe1 Programming 28 11-05-2005 16:37
Limit switches Team168 Programming 8 10-02-2003 16:22
Limit Switches/Pots Brett W Technical Discussion 3 28-01-2003 14:25


All times are GMT -5. The time now is 01:04.

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