Go to Post What is this, presto change-o rules every week? - Racer26 [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 19-02-2010, 20:34
LavaEagle LavaEagle is offline
Registered User
FRC #2660
 
Join Date: Oct 2009
Location: WA
Posts: 22
LavaEagle is an unknown quantity at this point
Limit Switch Programming Help (Have almost all of it figured out)

We have set up our robot exactly how you did this, wiring wise and then we had setup our limit switch exactly how the frcmastery.com video said to do it.



How we have our robot setup.
- a kicker is pulled back(by a victor) until limit switch is pushed
- victor then reverses until a limit switch 2 is pushed
- then waits for a button to be pushed (and the kicker is released.(this is irrelevant))

We can't get step 1 to even happen.
From everything we have looked up it looks good multiple tutorials past examples above examples.

The only thing different that we just found out is that we don't have a DIO Module set up in the programming.

At the moment programming is unable to edit the robots code?
  #2   Spotlight this post!  
Unread 20-02-2010, 00:49
PriyankP's Avatar
PriyankP PriyankP is offline
Registered User
FRC #0188 (Woburn Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Toronto, Canada
Posts: 87
PriyankP has much to be proud ofPriyankP has much to be proud ofPriyankP has much to be proud ofPriyankP has much to be proud ofPriyankP has much to be proud ofPriyankP has much to be proud ofPriyankP has much to be proud ofPriyankP has much to be proud ofPriyankP has much to be proud of
Re: Limit Switch Programming Help (Have almost all of it figured out)

The last time I played around with one of the limit switches in our room, I found out that the switch will continuously output 1 if its NOT pressed. As soon as it is pressed, it will output 0. (I use C/C++)

So what I did was,

DigitalInput switch; // A variable that will get a value of 1 or 0 depending on the limit switch...

then

swich(13), // The port id it uses

then in the Tele op continuous,



if button 2 is pressed then
turn the motor in the + direction

and

check if switch is equal to 0
if switch is 0 then
stop the motor


or else,
just stop the motor


I am pretty sure that if you use a code like that, you wont need the second limit switch. (if I am correct as to why you have it)

Now, you can convert this pseudo code into any programming language!!

Good Luck, I hope this helped!
__________________
Champs Schedule Highlighter App [CD Thread]

#### XYZ Regional Finalists

Last edited by PriyankP : 20-02-2010 at 00:51.
  #3   Spotlight this post!  
Unread 20-02-2010, 10:53
LavaEagle LavaEagle is offline
Registered User
FRC #2660
 
Join Date: Oct 2009
Location: WA
Posts: 22
LavaEagle is an unknown quantity at this point
Re: Limit Switch Programming Help (Have almost all of it figured out)

Does the limit switch need to be told the DIO Channel and the DIO Module?
or just the DIO Channel(In programming of course)

I believe we have been doing it right as far as the wiring goes. We're using black and white. White on the side tab and black on the NC or NO.
  #4   Spotlight this post!  
Unread 21-02-2010, 00:33
PriyankP's Avatar
PriyankP PriyankP is offline
Registered User
FRC #0188 (Woburn Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Toronto, Canada
Posts: 87
PriyankP has much to be proud ofPriyankP has much to be proud ofPriyankP has much to be proud ofPriyankP has much to be proud ofPriyankP has much to be proud ofPriyankP has much to be proud ofPriyankP has much to be proud ofPriyankP has much to be proud ofPriyankP has much to be proud of
Re: Limit Switch Programming Help (Have almost all of it figured out)

When I did it, I just gave the pin # in my code, the port on the sidecar that get the single PWM from the limit switch.

eg.
limitswitch(13),

~ Priyank

PS. Sorry, I don't know the "proper name" of those pins on the sidecar.
__________________
Champs Schedule Highlighter App [CD Thread]

#### XYZ Regional Finalists
  #5   Spotlight this post!  
Unread 22-02-2010, 00:23
Yuan Xue Lim's Avatar
Yuan Xue Lim Yuan Xue Lim is offline
Electrical Programmer
FRC #3017 (Project Genesis)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: NY
Posts: 37
Yuan Xue Lim is an unknown quantity at this point
Send a message via AIM to Yuan Xue Lim
Re: Limit Switch Programming Help (Have almost all of it figured out)

Quote:
Originally Posted by LavaEagle View Post
Does the limit switch need to be told the DIO Channel and the DIO Module?
or just the DIO Channel(In programming of course)

I believe we have been doing it right as far as the wiring goes. We're using black and white. White on the side tab and black on the NC or NO.
The limit switch must be connected to a female RC(PWM) connector to Digital I/O.

This is how you declare it.

Quote:
DigitalInput *limitswitch;
limitswtich = new DigitalInput(channel that you put in);
After that you should be fine. Remember that this will return you boolean statement in true or false not integers or floats.
__________________
[font="Fixedsys"][b]We Don't Hope We will.
Closed Thread


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 Switch Twisted eric Programming 8 22-02-2010 11:56
limit switch help program1 NI LabVIEW 10 15-02-2009 17:22
Using a limit switch to limit motion ManicMechanic Programming 16 20-12-2007 00:54
I've got it figured out!!! Andy Grady Rumor Mill 24 21-12-2006 19:25
gyro/accelecometer/limit switch help needed Anton Programming 4 04-02-2005 16:39


All times are GMT -5. The time now is 12:23.

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