tar zxvf servo-03.tar.gz cd servo-03/src make sudo make installInstalled files are /usr/local/lib/libservo.so and /usr/local/include/servo.h.
For the HD-1810MG Digital Mini Servo the gforth functions are: hd_setPosition, hd_getPosition, hd_center, and hd_sleep.
For the Parallax Continuous Rotation Servo the gforth functions are: pcr_setPosition, pcr_getPosition, pcr_center, and pcr_sleep.
There are two other generic functions: gservo_version, to get the gservo library version number; and gservo_test to run an interactive test routine.
Installation (creates /usr/local/lib/libgservo.so, /usr/local/include/gservo.h, and /usr/share/gforth/site-forth/gservo-03.fs):
tar zxvf gservo-03.tar.gz cd gservo-03 make sudo make installAfter installation, test using the Ctest standalone C program:
make Ctest sudo ./CtestTo use with gforth:
sudo gforth require gservo-03.fs ... gservo_test \ interactive testing ... hd_getPosition f. pcr_getPosition f. ...The first time you use the gservo-03 library, you may notice a startup delay as gforth will create gservo_03 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 gservo-03.fs.
gservo-03.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