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 zusammen,

 

ich habe mich mal an dem Servo Brick probiert.

Ich bekomme immerwieder diesen Fehler:

 

  File "C:\Users\...\servobrick.py", line 17, in <module>

    ipcon.add_device(servo)

  File "C:\Python27\lib\tinkerforge\ip_connection.py", line 402, in add_device

    raise Error(Error.TIMEOUT, msg)

tinkerforge.ip_connection.Error: -1: Could not add device 94ANbHfcMxy, timeout

 

 

Und das ist mein Code:

 

HOST = "localhost"
PORT = 4223
UID = "94ANbHfcMxy"

from tinkerforge.ip_connection import IPConnection
from tinkerforge.brick_servo import Servo

servo = Servo(UID)

ipcon = IPConnection(HOST, PORT) 
ipcon.add_device(servo)
    
servo.set_degree(0, -9000, 9000)    
servo.set_period(0, 20000)
servo.set_velocity(0, 10000) 
servo.set_acceleration(0, 10000)
servo.set_pulse_width(0, 500, 2200)

for i in range (-180, 180):
    #i = 70.3
    print i
    servo.set_position(0, i*100)
    servo.enable(0)

raw_input('Press key to exit\n') # Use input() in Python 3
ipcon.destroy()

 

 

Wenn ich den Servo Brick wieder aus und einstecke klappt das Programm 1 mal, danach kommt wieder der gleiche Fehler

 

Ich hoffe Ihr könnt mir helfen

Vielen Dank im vorraus

Geschrieben

Mir fällt auf den ersten Blick nur auf, dass du im set_position Werte außerhalb des Bereichs von set_degree übergibst (-18k bis +18k statt -9k bis +9k).

 

Aber das sollte dein Servo-Brick nicht killen...

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.