Last active
August 29, 2015 14:11
-
-
Save madhephaestus/6f9d1cef5878ed056f61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CounterOutputAsyncTest implements ICounterOutputListener { | |
CounterOutputChannel stepper; | |
public CounterOutputAsyncTest () { | |
//Instantiate a new counter input | |
stepper=new CounterOutputChannel(dyio.getChannel(21)); | |
stepper.addCounterOutputListener(this); | |
// Move 5 steps | |
stepper.SetPosition(10000, 30); | |
ThreadUtil.wait(30000); | |
stepper.SetPosition(0, 0); | |
stepper.removeCounterOutputListener(this); | |
} | |
@Override | |
public void onCounterValueChange(CounterOutputChannel source, int value) { | |
if(source == stepper) { | |
System.out.println("Current Position is: "+value); | |
} | |
} | |
} | |
new CounterOutputAsyncTest (); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment