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(self, drvname, addr=0x78, clk=100000)

Create an instance of the OC05 class.

Parameters:
  • drvname – I2C Bus used ‘( I2C0, ... )’
  • addr – Slave address, default 0x78
  • clk – Clock speed, default 100kHz
init(outFreq)

Configures the registers of PCA9685 and sets the frequency of modulation. Call before using OC05

Parameters: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.

Parameters:
  • channelNum – Number of the channel. Corresponds to channel numbers on OC05 (1-8)
  • degrees – Desired rotational distance in degrees
setPinPulseRange(pinNum, onStep, offStep)

Sets the PWM output on a selected pin.

Parameters:
  • 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)
setCRServoPosition(channelNum, speed)

Used to set the rotation speed of a continous rotation servo from -100% to 100%.

Parameters:
  • 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