riks Geschrieben February 6, 2024 at 17:21 Geschrieben February 6, 2024 at 17:21 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 Zitieren
borg Geschrieben February 12, 2024 at 11:18 Geschrieben February 12, 2024 at 11:18 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. Zitieren
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.