Go to Post My puppy certainly thanks the many teams that handed out frisbees this year. - VexisDarksteele [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 24-02-2013, 15:30
Mr.Roboto3335's Avatar
Mr.Roboto3335 Mr.Roboto3335 is offline
Wait, What?
AKA: Jimmy
FRC #3335 (Cy-Borgs)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Texas
Posts: 47
Mr.Roboto3335 is an unknown quantity at this point
Programming Limit Switch

I have no idea how to program a limit switch. If anyone could give me an example or link on how to program one it would be appreciated.
__________________
Wait, what?
Reply With Quote
  #2   Spotlight this post!  
Unread 24-02-2013, 16:56
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: Programming Limit Switch

Quote:
Originally Posted by Mr.Roboto3335 View Post
I have no idea how to program a limit switch. If anyone could give me an example or link on how to program one it would be appreciated.
What are you doing with it?

Here's the basic code:

Code:
DigitalInput limitSwitch;

    public RandomSubsystem() {
        
        limitSwitch = new DigitalInput(1);     //1 = the DIO port of the sensor
    }

   public boolean getLimitSwitch() {
        return limitSwitch.get();
    }

   public void doSomething() {
        if(getLimitSwitch() == false) {
             doSomething();
        }
    }

Then call doSomething() from a command and set the isFinished() method to trigger when getLimitSwitch() returns true.
__________________
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
  #3   Spotlight this post!  
Unread 24-02-2013, 18:26
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,042
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Programming Limit Switch

Quote:
Originally Posted by Mr.Roboto3335 View Post
I have no idea how to program a limit switch. If anyone could give me an example or link on how to program one it would be appreciated.
FWIW, if you plug it directly into a Jag you don't need to program it.


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:07.

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