New Library: PCA9685

14-Jul-2018

 

The Great Cow BASIC development team have published support for the PCA9685.

 The PCA9685 is an I2C-bus controlled 16-channel LED controller optimized for servoes and Red/Green/Blue/Amber (RGBA) color backlighting applications.

Each output has its own 12-bit resolution (4096 steps) fixed frequency individual PWM controller that operates at a programmable frequency from a typical of 24 Hz to 1526 Hz with a duty cycle that is adjustable from 0 % to 100 % to allow the LED to be set to a specific brightness value.

 

  The board is available from many sources. A typical board looks like this.

 

  The library supports hardware I2C and software I2C.   Download the new library from here.

 

 

The public methods in the library are shown below - these public methods will ease the use of this complex board.

PCA9685_SetFreqency ( frequency_wordvalue ) a value from 24 to 1526
PCA9685_SetChannelDuty(  channel as byte , duty as word )  where duty is 0 to 100%
PCA9685_SetChannelOnOnly ( channel as byte , OnValue as word ) where Onvalue is 0 to 4095
PCA9685_SetChannelOffOnly ( channel as byte , OffValue as word ) where Offvalue is 0 to 4095
PCA9685_WriteChannel( channel as byte, OnValue as word, OffValue  as word ) ranges of 0 to 4095

 

 

Demonstrations

A full suite of demonstrations are in GitHub. The demos cover simple ON and OFF, simple usage, variable Duty (16bit and Percentage) and change frequency.   Download the demonstrations from GitHub here.

 

Enjoy the new library for Great Cow BASIC.

 


Categories: Release, Site News