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.

Barkeeper

Members
  • Benutzer seit

  • Letzter Besuch

  1. Hallo, ich habe mich durch die Python-Beispiele gearbeitet und bin meinem Ziel schon recht nahe. Nun benötige ich aber eure Hilfe… Ziel: Servo 6: Position wird durch RotaryPoti eingestellt (OK) Servo 5: wechselt Position von -90 auf +90 bei Tasterdruck an IO4-Bricklet (OK) Servo 4: wechselt beim loslassen des Taster für Servo 5 von -90 zu +90 und zurück zu -90 (mein Problem) Hintergrund: Fernsteuerung eines mechanischen Verschlusses (Copal 0) einer Fotokamera. Servo 6 verstellt die Blende Servo 5 löst den Verschluss aus Servo 4 spannt den Verschluss erneut (Anleitung des Verschlusses: Copal No. 0 nur für den Hintergrund: http://www.schneiderkreuznach.com/pdf/zubehoer/copal_0.pdf) Mein bisheriges Skript: #!/usr/bin/env python # -*- coding: utf-8 -*- HOST = "localhost" PORT = 4223 UID_SERVO = "***" # Changed to the UID of my Servo Brick UID_POTI = "***" # Changed to the UID of my Rotary Poti Bricklet UID_IO4 = "***" # Changed to the UID of my IO4 Bricklet from tinkerforge.ip_connection import IPConnection from tinkerforge.brick_servo import Servo from tinkerforge.bricklet_rotary_poti import RotaryPoti from tinkerforge.bricklet_io4 import IO4 # Callback function for position callback (parameter has range -150 to 150) def cb_position(poti_position): servo_position = 9000*poti_position/150 # Poti-Position: -9000/9000 print('Set Position/Velocity: ' + str(poti_position) + '/' + str(servo_position)) servo.set_position(6, servo_position) # Callback function for interrupts def cb_interrupt(interrupt_mask, value_mask): print('Interrupt by: ' + str(bin(interrupt_mask))) print('Value: ' + str(bin(value_mask))) if value_mask & (1 << 0): servo.set_position(5, 9000) else: servo.set_position(5, -9000) if __name__ == "__main__": ipcon = IPConnection(HOST, PORT) # Create IP connection to brickd servo = Servo(UID_SERVO) # Create device object poti = RotaryPoti(UID_POTI) # Create rotary poti device object io = IO4(UID_IO4) # Create input output 4 object ipcon.add_device(servo) # Add device to IP connection ipcon.add_device(poti) # Add device to IP connection ipcon.add_device(io) # Add device to IP connection # Enable interrupt on pin 0 io.set_interrupt(1 << 0) # Register callback for interrupts io.register_callback(io.CALLBACK_INTERRUPT, cb_interrupt) poti.set_position_callback_period(50) # set callback period to 50ms poti.register_callback(poti.CALLBACK_POSITION, cb_position) servo.set_pulse_width(6, 1000, 2000) servo.set_period(6, 19500) servo.set_acceleration(6, 0xFFFF) # Full acceleration servo.set_velocity(6, 0xFFFF) # Full speed servo.enable(6) # enable Servo No. 6 servo.set_pulse_width(5, 1000, 2000) servo.set_period(5, 19500) servo.set_acceleration(6, 0xFFFF) # Full acceleration servo.set_velocity(5, 0xFFFF) # Full speed servo.enable(5) # enable Servo No. 5 raw_input('Press Enter to exit\n') # Use input() in Python 3 ipcon.destroy() Wie bekomme ich es hin, dass der Servo 4 diese "hin- und her"-Bewegung beim loslassen des Tasters macht? Vielen Dank im Voraus, Barkeeper

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.