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,

ich habe gestern meine ersten TF Module bekommen und hatte innerhalb von 10 min per Wifi die ersten LIDAR Messwerte :-)

Ermutigt davon habe ich begonnen die Python Scripte auf einem Raspi auszuprobieren.

Das Simple Script lieferte auch anstandslos ein Ergebnis. Callback und Threshold produzieren aber noch einige Fehler. Als TF und Python Einsteiger dann doch etwas zu viele Fehler...

Was könnte da schieflaufen?

>>> execfile("/home/pi/tinkerforge/example_simple.py")
Distance: 14671 cm
Press key to exit
>>> execfile("/home/pi/tinkerforge/example_callback.py")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/tinkerforge/example_callback.py", line 29, in <module>
    lrf.set_distance_callback_period(200)
  File "/usr/local/lib/python2.7/dist-packages/tinkerforge/bricklet_laser_range_finder.py", line 156, in set_distance_callback_period
    self.ipcon.send_request(self, BrickletLaserRangeFinder.FUNCTION_SET_DISTANCE_CALLBACK_PERIOD, (period,), 'I', '')
  File "/usr/local/lib/python2.7/dist-packages/tinkerforge/ip_connection.py", line 960, in send_request
    raise Error(Error.INVALID_PARAMETER, msg)
tinkerforge.ip_connection.Error: Got invalid parameter for function 3 (-9)

 

Schlussendlich wäre mein Ziel mit dem Lidar Geschwindigkeiten zu messen und die jeweiligen Max V in eine Datei zu Schreiben, so eine Art Speed Trap...

 

Über jede Hilfe wäre ich dankbar,

 

Gruß

Frank

Geschrieben
  • Autor

Jupp, in allen drei Beispiel Scripts habe ich die gleiche UID zugewiesen.

Welche Python Version wird eigentlich vorausgesetzt?

Ich hatte zunächst 2.7 ausprobiert und dafür die Bindings per "pip install tinkerforge" nachinstalliert. Danach lief dann das Example_simple.py .

Brauchen die anderen vielleicht zwingend 3.x ?

 

Grüsse

Frank

Geschrieben
  • Autor

Ich habe die UID vom Master-Brick eingesetzt nicht die vom Bricklet.

Ich dachte der Master-Brick verwaltet alle angeschlossenen Bricklets?

Funktioniert beim Simple Script ja auch.

 

Gruß

Frank

Geschrieben

Du muss immer die UID des Bricks oder Bricklets nehmen mit dem du arbeiten willst. Wie die Bricklets an Bricks angeschlossen sind spielt keine Rolle.

 

Und es funktioniert eben nicht beim Simple Beispiel. Das sieht nur aus als ob:

 

Distance: 14671 cm

 

Das sind 146,71 m, das Laser Range Finder Bricklet misst aber maximal bis 40 m.

Geschrieben
  • Autor

AAAH....

ich hatte 14671 als mm interpretiert (was gut gepasst hat) und die cm als kleinen Bug ignoriert :-)

Probiere ich heute Abend mal aus!

 

Gruß

Frank

Geschrieben
  • Autor

So, nun hatte ich endlich Zeit zum ausprobieren.

Mit der UID des Bricklets klappen jetzt die Beispiele mit Python auch bei mir :-)

 

Gruß

Frank

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.