Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Geschrieben

Hallo,

in dem Rust Beispiel (https://www.tinkerforge.com/de/doc/Software/Bricklets/SilentStepperV2_Bricklet_Rust.html#silent-stepper-v2-bricklet-rust-examples) werden die Funktionen zum Setup des Steppers mit .recv()?; aufgerufen. Bei mir führt dies zu einem Abbruch des Programms, weil .recv() ein Result mit Error zurückgibt.
In dem Fehlertext steht zwar, dass es eigentlich kein Fehler sei, aber es wird halt ein Fehler ausgegeben, der Zum Abbruch führt.

Ohne den Aufruf von .recv() ginge es auch:

ss.set_motor_current(800);

Viele Grüße
Jan

bearbeitet von Jan S.
My misunderstanding.

  • Jan S. changed the title to Rust Beispiel Silent Stepper V2: .recv() führt zu Fehler
Geschrieben

Hi Jan,

Ich kann es selber nicht testen, weil ich kein Stepper Bricklet habe. Meinst du den folgenden Fehler? 

Err(BrickletRecvTimeoutError::SuccessButResponseExpectedIsDisabled)

Wenn ja, was passiert, wenn du

ss.set_response_expected(SILENT_STEPPER_V2_BRICKLET_FUNCTION_SET_MOTOR_CURRENT, true)

zu Beginn ausführt? Wenn nein, dann weiß ich auch nicht so genau ;-)

Ist das auch bei den anderen recv() Aufrufen?

bearbeitet von cl-

Geschrieben
  • Autor

Hallo cl-,

super, das scheint zu funktionieren.

Bei den anderen Funktionen aus dem Beispiel hatte ich auch 

BrickletRecvTimeoutError::SuccessButResponseExpectedIsDisabled

zurück bekommen, aber mit

ss.set_response_expected_all(true);

kann man die ja alle auf einmal erschlagen.
Allerdings erfordert der Aufruf von set_response_expected_all(), dass man die Variable ss mutable macht.

Ich bleibe also erst mal dabei, dass ich die Rückgabewerte ignoriere.

ss.set_motor_current(800);

Vielen Dank für Deine hilfreiche Antwort
Jan

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.