Adafruit PWM gforth interface

Here is a gforth interface for the C++ library routines (written by Sarvesh Kulkarni) for use with Adafruit's PCA9685 16-channel PWM breakout board.
The C++ library must be installed first: download pca9685_pwm-09.tar.gz; browse src
  tar zxvf pca9685_pwm-09.tar.gz
  cd pca9685_pwm-09/src
  make
  sudo make install
Installed files are /usr/local/lib/libpca9685_pwm.so and /usr/local/include/pca9685_pwm.h.
Version 09 defines gforth interfaces for all of the PWM_Board public methods, with gforth names like pwm_setFreq corresponding to the C++ class method setFreq().

Installation (creates /usr/local/lib/libpwm.so, /usr/local/include/pwm.h, and /usr/share/gforth/site-forth/pwm-09.fs):

  tar zxvf pwm-09.tar.gz
  cd pwm-09
  make
  sudo make install
After installation, test using the Ctest standalone C program:
  make Ctest
  sudo ./Ctest
To use with gforth:
  sudo gforth
  require pwm-09.fs
  ...
  pwm_test			\ interactive testing
  ...
  20e0 pwm_setFreq .		\ manual testing, need e0 for floating-point
  50e0 0 0e0 pwm_setDutyCycle .
  ...
The first time you use the pwm-09 library, you may notice a startup delay as gforth will create pwm_09 C and object files in your ~/.gforth/libcc-named/ directory. Thereafter, there will be no startup delay as these files will be used automatically whenever you require pwm-09.fs.

pwm-09.tar.gz - download

src - browse files

References:
http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/ - Gforth Manual
  section 5.25 - C Interface
PCA 9685 Data Sheet