Skip to content

Instantly share code, notes, and snippets.

@madhephaestus
Last active August 29, 2015 14:11
Show Gist options
  • Save madhephaestus/6f9d1cef5878ed056f61 to your computer and use it in GitHub Desktop.
Save madhephaestus/6f9d1cef5878ed056f61 to your computer and use it in GitHub Desktop.
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