Jump to content

Search the Community

Showing results for tags 'dualbutdualbutton'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Deutsch
    • Allgemeine Diskussionen
    • Anfängerfragen und FAQ
    • Software, Programmierung und externe Tools
    • Hardware
    • Projektvorstellungen und Projektideen
  • English
    • General Discussion
    • Project introductions and project ideas

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me

Found 1 result

  1. Hallo zusammen, ich habe folgendes Problem: Ich habe einen DualButton und möchte Testweise die linke LED mit Python einschalten. Ich habe das Beispielprogramm genommen und erweitert, aber es will nicht so wie ich will. HOST = "localhost" PORT = 4223 UID_dualButton = "MeA" # Change XYZ to the UID of your Dual Button Bricklet 2.0 from tinkerforge.ip_connection import IPConnection from tinkerforge.bricklet_dual_button_v2 import BrickletDualButtonV2 def cb_state_changed(dualbutton_l, dualbutton_r, led_l, led_r): # Callback function for state changed callback if dualbutton_l == BrickletDualButtonV2.BUTTON_STATE_PRESSED: print("Linker Button: gedrückt") elif dualbutton_l == BrickletDualButtonV2.BUTTON_STATE_RELEASED: print("Linker Button: nicht gedrückt") if dualbutton_r == BrickletDualButtonV2.BUTTON_STATE_PRESSED: print("Rechter Button: gedrückt") elif dualbutton_r == BrickletDualButtonV2.BUTTON_STATE_RELEASED: print("Rechter Button: nicht gedrückt") print("") if __name__ == "__main__": ipcon = IPConnection() # Create IP connection db = BrickletDualButtonV2(UID_dualButton, ipcon) # Create device object ipcon.connect(HOST, PORT) # Connect to brickd # Don't use device before ipcon is connected #------------------------------ Dies sind meine Versuche #db.setLEDState(BrickletDualButton.LED_STATE_ON, BrickletDualButton.LED_STATE_OFF) # db.set_selected_led_state(BrickletDualButtonV2.LED_STATE_OFF, BrickletDualButtonV2.LED_STATE_ON) #db.BrickletDualButtonV2.set_selected_led_state(0, 2) #print(BrickletDualButtonV2.get_led_state()) # BrickletDualButtonV2.set_selected_led_state(0, 2) # BrickletDualButtonV2.set_led_state(2, 2) #----------------------------- # Register state changed callback to function cb_state_changed db.register_callback(db.CALLBACK_STATE_CHANGED, cb_state_changed) db.set_state_changed_callback_configuration(True) # Enable state changed callback input("Press key to exit\n") ipcon.disconnect() Wo ist da der Fehler? Vielen Dank im Voraus.
×
×
  • Create New...