Project: PALM SV203 SERIAL CONTROL LIBRARY The library was designed to send commands and receive analog to digital sensor input from a Pontech SV203 microcontroller board. The library consists of one class ("PalmSV203.cpp/h" - SV203 class) and several support files. This has functions to control all servo functions (absolute move, incremental move, zero pulse, direct digital pin set/clear/toggle, and analog to digital sensor inputs. There is also a test program the utilizes most/all functionality of the library, that can be run standalone on the Palm to test an SV203 board. Author: Mike Dearman (dearman@cse.buffalo.edu ; http://www.cse.buffalo.edu/~dearman) Library Version: 1.2 Original code designed by PONTECH, Copyright 1996, Date: 11/09/1996 Modified for use on PalmOS with Pontech SV203 Servo Control Board Any comments, suggestions, bugs should be reported to the author. Copyright (C) 2002 Michael Dearman This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ********************************************************************************************** How To Use ----------- Include the include file "palmSV203.h" and create an instance of the SV203 class. See the Palm SV203 library demo to see the class initialization and servo controls in action. Don't forget to delete the class (either through delete, or by calling the PortClose function). Class Functions Available -------------------- Constructors/Destructors SV203(); SV203(ComPorts comPort = COM1, BaudRates baudRate = BAUD9600); ~SV203(); Port Initialization/Shutdown Boolean PortOpen(ComPorts comPort = COM1, BaudRates baudRate = BAUD9600); Boolean PortClose(); Boolean isPortOpen(); Board Selection Boolean SelectBoard(UInt16 board = 1); Servo Motor Controls Boolean MoveServo(SV203Servo servo, UInt16 position); Boolean IncrMoveServo(SV203Servo servo, Int16 incrPos); Boolean MoveAllServos(UInt16 S1, UInt16 S2, UInt16 S3, UInt16 S4, UInt16 S5, UInt16 S6, UInt16 S7, UInt16 S8); // Servo control functions for continuous rotation servos Boolean RotateServo(SV203Servo servo, UInt16 speed, RotationDirection direction); // Turns off servo motor Boolean TurnOffServo(SV203Servo servo); Boolean TurnOffAllServos(); Direct Digital Output of Servo Signals Boolean PinSet(SV203Servo servo); Boolean PinClear(SV203Servo servo); Boolean PinToggle(SV203Servo servo); Analog to Digital Sensor Input UInt16 GetADSensor(SV203Sensor sensorID); Boolean GetAllADSensors(UInt16 *S1, UInt16 *S2, UInt16 *S3, UInt16 *S4, UInt16 *S5); Delay Functionality Boolean Delay(UInt16 milliseconds); // Task delay - does not use SV203 board delay command Boolean SysDelay(UInt16 milliseconds); Raw Command Communication Boolean SendCommand(Char* cmd, UInt16 param); Boolean SendCommands(Char* commands); How to Use Palm SV203 Library Demo ----------------------------------- Download SV203Test.prc to your Palm. Connect the special Palm Serial connector to a 9-pin serial connector ( tx, rx, and ground pins ). See the Palm documentation on making such a cable. Run the demo. By clicking on servo buttons 1-8, you can select one or more servos to control at a time. You can move the servos using the scrollbar, incremental movement -5 and 5 units from the current position, send a zero pulse, and pin set/clear/toggle. To get A to D input, select the sensor you want a reading from, click on the sensor ID and hit "Get Reading". The sensor input will be displayed in the field to the right of the button.