Go to Post it should not matter the gender of a person but rather their ability. - vivek16 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 18-02-2013, 21:48
Negative 9 Negative 9 is offline
Registered User
FRC #0611
 
Join Date: Dec 2012
Location: Mclean, VA
Posts: 46
Negative 9 is an unknown quantity at this point
Re: How do you program limit switches?

Quote:
Originally Posted by Zer0 View Post
Im working on the same thing for my team for tomorrow. What are you trying to control with the switch?
A motorized car jack that stops working when it goes too low or too high
Reply With Quote
  #2   Spotlight this post!  
Unread 18-02-2013, 21:55
dheerm's Avatar
dheerm dheerm is offline
Drive Team and Head Programmer
AKA: Dheer Mirchandani
FRC #0224 (The Tribe)
Team Role: Programmer
 
Join Date: Oct 2012
Rookie Year: 2010
Location: Piscataway
Posts: 37
dheerm will become famous soon enough
Re: How do you program limit switches?

DigitalInput name = new DigitalInput(slot)


fill in slot with the slot on the DIO that the switch is plugged into and name with whatever you want to call it.

name.get() will return you the boolean indicating whether the switch is pressed or Unpressed. If it's wired right, true will be pressed and false will be unpressed
__________________
"All you need is duct tape and a dream"

Team 224:
District Champions @TCNJ w/ Team 56 and Team 293

8th alliance captain at MAR championships w/ (take a guess) , Team 56 and Team 293.

www.team224.com
Reply With Quote
  #3   Spotlight this post!  
Unread 18-02-2013, 23:06
Bill_B Bill_B is offline
You cannot not make a difference
FRC #2170
 
Join Date: Jan 2010
Rookie Year: 2004
Location: Connecticut
Posts: 1,099
Bill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond repute
Re: How do you program limit switches?

Quote:
Originally Posted by Negative 9 View Post
A motorized car jack that stops working when it goes too low or too high
Scissor jack? Very suave just to think of it.
__________________
Nature's Fury FLL team 830 - F L eLements
FRC team 2170 - Titanium Tomahawks
Reply With Quote
  #4   Spotlight this post!  
Unread 18-02-2013, 23:10
Negative 9 Negative 9 is offline
Registered User
FRC #0611
 
Join Date: Dec 2012
Location: Mclean, VA
Posts: 46
Negative 9 is an unknown quantity at this point
Re: How do you program limit switches?

Quote:
Originally Posted by Bill_B View Post
Scissor jack? Very suave just to think of it.
Yup! We use it to change the angle of our shooter.
Reply With Quote
  #5   Spotlight this post!  
Unread 19-02-2013, 00:33
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
Re: How do you program limit switches?

Quote:
Originally Posted by Negative 9 View Post
Yup! We use it to change the angle of our shooter.
Awesome! So are we

Here's ours:

https://sphotos-a.xx.fbcdn.net/hphot...42295922_n.jpg

https://sphotos-a.xx.fbcdn.net/hphot...83332209_n.jpg

https://sphotos-a.xx.fbcdn.net/hphot...17571241_n.jpg
__________________
Research is what I’m doing when I don’t know what I’m doing.
- Wernher von Braun
Attending: Raleigh NC Regional
Reply With Quote
  #6   Spotlight this post!  
Unread 19-02-2013, 01:44
arithehun arithehun is offline
Registered User
AKA: Ari Falkner
FRC #3024
Team Role: Programmer
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Ashland, Oregon
Posts: 27
arithehun is an unknown quantity at this point
Re: How do you program limit switches?

For some of you using command based programming, I noticed that the DigitalIOButton class wasn't working properly, so I programmed my own DigitalButton class using the very-functional DigitalInput class.

Code:
public class DigitalButton extends Button {
    private int channel;
    DigitalInput buttonInput;
    
    public DigitalButton(int channel) {
        this.channel = channel;
        buttonInput = new DigitalInput(channel);
    }

    public int getChannel() {
        return this.channel;
    }
    
    public boolean get() {
        return buttonInput.get();
    }
    
}
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 10:08.

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