Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Programming Limit Switch (http://www.chiefdelphi.com/forums/showthread.php?t=114318)

Mr.Roboto3335 24-02-2013 15:30

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.

F22Rapture 24-02-2013 16:56

Re: Programming Limit Switch
 
Quote:

Originally Posted by Mr.Roboto3335 (Post 1239709)
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.

Ether 24-02-2013 18:26

Re: Programming Limit Switch
 
Quote:

Originally Posted by Mr.Roboto3335 (Post 1239709)
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.




All times are GMT -5. The time now is 10:07.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi