riks Posted February 6, 2024 at 05:21 PM Share Posted February 6, 2024 at 05:21 PM Hi, I don't see any examples how to extend callback listeners or create new ones. Just an example with no meaning in Java from the documentation. device.addExampleListener(new BrickletServoV2.ExampleListener() { public void property(int value) { System.out.println("Value: " + value); } }); For the servo there a 2 OOTB examples, but I want to create my own for getCurrentPosition or current used on the servo as example. How do I implement this properly ? Regards, Rik Quote Link to comment Share on other sites More sharing options...
borg Posted February 12, 2024 at 11:18 AM Share Posted February 12, 2024 at 11:18 AM Unfortunately the Servo Bricklet only has callbacks for positionReached. You can find a complete example for it here: https://www.tinkerforge.com/en/doc/Software/Bricklets/ServoV2_Bricklet_Java.html#callback If you want a Listener for getCurrentPosition you will have to call getCurrentPosition and implement a Listener-mechanism for that yourself. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.