SparkFun PiServoHat Initialise the qwiic_pca9685 python module at address
with i2c_driver
. More...
SparkFun PiServoHat Initialise the qwiic_pca9685 python module at address
with i2c_driver
.
None
, debug = None
, min_pt = 1
, max_pt = 2
)
This method initializes the class object.
If no 'address' or 'i2c_driver' are inputed or 'None' is specified, the method will use the defaults.
Reads and returns the current min and max pulse times for servo movement.
Returns: tuple: The minimum and maximum pulse times in milliseconds
◆ get_pwm_frequency() def pi_servo_hat.PiServoHat.get_pwm_frequency ( self )Reads the PWM frequency used on outputs.
50 Hz is recommended for most servos.
None
)
Reads the specified location for the servo in degrees.
Is an I2C connection established with the device?
None
)
Moves servo to specified location in degrees.
Soft resets the chip and then clears the MODE1 register to restart the PWM functionality.
The PWM frequency is returned to the default 50 Hz setting.
◆ set_duty_cycle() def pi_servo_hat.PiServoHat.set_duty_cycle ( self, channel, duty_cycle )Moves servo to specified location based on duty-cycle.
Updates the minimum and maximum pulse widths for the servos.
Args: min_pulse_time (float): The new minimum pulse width in ms max_pulse_time (float): The new maximum pulse width in ms
Returns: bool: Returns true if update was successful, false if an error was encountered
◆ set_pwm_frequency() def pi_servo_hat.PiServoHat.set_pwm_frequency ( self, frequency =None
)
Configures the PWM frequency used on outputs.
50 Hz is the default and recommended for most servos.
NOTE: Changing PWM frequency affects timing for servo positioning. Additionally, the servo position needs to be reset for the output control (on all channels). The output on all channels is initially turned off after the frequency change, but is re-enabled after any of the channels is reconfigured. However, the new PWM frequency will be in affect, so the timing of the outputs on the other channels will be off. (i.e. if a PWM frequency is doubled; the timing of that signal may be halfed.)
◆ sleep() def pi_servo_hat.PiServoHat.sleep ( self )Set the SLEEP bit to 1, which will unpower the servos.
This preserves the life of the servos.
◆ wake() def pi_servo_hat.PiServoHat.wake ( self )Set the SLEEP bit to 0, which will power the servos.
◆ acAddr int pi_servo_hat.PiServoHat.acAddr = 0x70 static ◆ address pi_servo_hat.PiServoHat.address ◆ available_addresses pi_servo_hat.PiServoHat.available_addresses = _AVAILABLE_I2C_ADDRESS static ◆ available_pwm_channels pi_servo_hat.PiServoHat.available_pwm_channels ◆ debug pi_servo_hat.PiServoHat.debug ◆ device_name pi_servo_hat.PiServoHat.device_name = _DEFAULT_NAME static ◆ frequency pi_servo_hat.PiServoHat.frequency = _DEFAULT_SERVO_FREQUENCY static ◆ gcAddr int pi_servo_hat.PiServoHat.gcAddr = 0x00 static ◆ maximum_pulse_width pi_servo_hat.PiServoHat.maximum_pulse_width ◆ minimum_pulse_width pi_servo_hat.PiServoHat.minimum_pulse_width ◆ PCA9685 pi_servo_hat.PiServoHat.PCA9685 ◆ subAddr_1 int pi_servo_hat.PiServoHat.subAddr_1 = 0x71 static ◆ subAddr_2 int pi_servo_hat.PiServoHat.subAddr_2 = 0x72 static ◆ subAddr_3 int pi_servo_hat.PiServoHat.subAddr_3 = 0x74 staticThe documentation for this class was generated from the following file:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4