OC05 Module¶
This is a Module for the OC05 8-channel Servo Driver. The xChip is based off the PCA9685 LED controller manufactured by NXP Semiconductors. The board uses I2C for communication.
Data Sheets:
OC05 class¶
class OC05¶
class OC05(self, drvname, addr=0x78, clk=100000)
Arguments:
- drvname – I2C Bus used ‘( I2C0, … )’
- addr – Slave address, default 0x78
- clk – Clock speed, default 100kHz
OC05.init¶
init(outFreq)
Configures the registers of PCA9685 and sets the frequency of modulation. Call before using OC05
Arguments: outFreq – Frequency of servo motor, default 60 for typical analogue servos.
´´setServoPosition(channelNum, degrees)`
Positions a servo on a selected channel by the desired degrees.
Arguments:
- channelNum – Number of the channel. Corresponds to channel numbers on OC05 (1-8)
- degrees – Desired rotational distance in degrees
OC05.setPinPulseRange¶
setPinPulseRange(pinNum, onStep, offStep)
Sets the PWM output on a selected pin.
Arguments:
- pinNum – Number of the channel. Corresponds to channel numbers on OC05 (1-8)
- onStep – The point at which to turn the PWM output ON (0-4095)
- offStep – The point at which to turn the PWM output OFF (0-4095)
OC05.setCRServoPosition¶
setCRServoPosition(channelNum, speed)
Used to set the rotation speed of a continous rotation servo from -100% to 100%.
Arguments:
- channelNum – Number of the channel. Corresponds to channel numbers on OC05 (1-8)
- speed – speed [-100-100] The speed (-100-100) to turn the servo at