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 Forum

 

Ich habe ein grundsätzliches Verständnisproblem bei der Callback-Funktion des AnalogIn 2.0:

Als Start habe ich das Threshold-Beispiel genommen

https://github.com/Tinkerforge/analog-in-v2-bricklet/raw/master/software/examples/python/example_threshold.py

und leicht angepasst:

ai.set_voltage_callback_threshold("i", 5*1000, 20*1000)

 

Nach meinem Verständnis sollte immer die Callback-Funktion aufgerufen werden, wenn die Spannung zwischen 10 und 20 Volt zu liegen kommt.

Ich wechsele die Spannung am Bricklet zwischen 0 und 15 Volt. Im BrickViewer wird alles korrekt ausgegeben. Im Python-Code passiert aber nichts. Die Callback-Funktion erscheint nicht sofort.

Erst nach dem drücken einer Taste werden einige Zeilen mit den Volt ausgegeben.

 

Kann mir jemand einen Hint geben? Das wäre super.

 

Mit den besten Grüssen,

Yvo

Geschrieben

Mh, also wenn ich den Code so nehme wie er im Beispiel ist und die UID anpasse sowie threshold Konfiguration durch "ai.set_voltage_callback_threshold("i", 5*1000, 20*1000)" ersetze funktioniert das bei mir genau so wie du es Beschrieben hast.

 

Hattest du die UID bei dir angepasst?

 

Brick Viewer nutzt übrigens Getter, daher ist die Anzeige im Brick Viewer von den Callback-Konfigurationen unabhängig.

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.