|
Hoppie Home
PS1 Phidgets Driver
|
Load the DLL into Tcl with load phtcl. This sets up the Phidgets
interface. Each connected device has a device type code (a straightforward
string, such as servo) and a device number (starts from zero). There
are no provisions yet to identify which servo controller you want to operate
if you have more than one. That will come, using the unique serial number of
each board.
Phidgets Tcl Commands
The new Tcl commands are provided in the ph:: name space. They
are:
| ph::version |
| Returns the version string of the DLL, such as 1.2. |
| |
| ph::devices |
| Returns a list containing all supported devices, but is
not fully developed yet. |
| |
| ph::notify eventProc |
NOT IMPLEMENTED YET
Registers a Phidget input callback. The
eventProc script is called with four parameters: devType, devNr, control,
and value. If the eventProc={}, the callback is de-registered. Various
devices have different control strings. For a list, see Phidgets Input
Events. If during the callback a Tcl error occurs, the bgerror
procedure is called, just as with standard Tcl event handling procedures. |
| |
| ph::servo servoNr command value |
| Sets the position of a given servo.
The only recognised command currently is setPosition. The value
usually needs to be between -10 and 200, but between 0 and 180 is safer. |
| |
Phidgets Input Events
NOT IMPLEMENTED YET
|