Elixir PCA9685 16 channel 12 bit PWM driver driver
Find a file
James Harton b1c5dda678 Merge branch 'renovate/configure' into 'master'
Configure Renovate

See merge request jimsy/pca9685!1
2020-07-21 02:46:48 +00:00
config PCA9685 Driver. 2019-10-07 16:13:38 +13:00
lib Fix typo in docs. 2019-10-08 14:29:03 +13:00
test Empty OTP application. 2019-10-07 15:32:17 +13:00
.formatter.exs Empty OTP application. 2019-10-07 15:32:17 +13:00
.gitignore Empty OTP application. 2019-10-07 15:32:17 +13:00
LICENSE Add LICENSE 2019-10-08 01:29:36 +00:00
mix.exs Refactor the PCA9685 driver. 2019-10-08 14:28:18 +13:00
mix.lock PCA9685 Driver. 2019-10-07 16:13:38 +13:00
README.md Fix typo in docs. 2019-10-08 14:29:03 +13:00
renovate.json Add renovate.json 2020-07-21 02:34:00 +00:00

PCA9685

Driver for PCA9685 based 16 channel, 12 bit PWM driver connected over I2C.

Usage

Add your device to your config like so:

config :pca9685,
  devices: [%{bus: "i2c-1", address: 0x40}]

The properties bus and address are mandatory. You can optionally provide pwm_freq which is the output frequency you'd like to set (in Hz) and oe_pin which is the GPIO pin that you want to use for the output-enable function. Remember that the OE pin is expecting to be driven high to +5V, so won't work on a Raspberry Pi without a level shifter of some kind.

Your devices will be reset and you will be able to drive the outputs with your specified output frequency and duty cycle.

Installation

If available in Hex, the package can be installed by adding pca9685 to your list of dependencies in mix.exs:

def deps do
  [
    {:pca9685, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/pca9685.