The goal of this project is to be able to control some of the Phidgets USB boards via the FEZ Domino. Phidgets ( http://www.phidgets.com ) have many USB and analog sensors that connects to each other and the whole thing is controlled by a PC via USB cable.
Being able to use those sensors and boards will greatly expand the (already huge) FEZ Domino capacities.
You will find here drivers for the following Phidgets boards :
- 1018 InterfaceKit 8/8/8
- 1052 Digital Encoder
Other drivers may come if time/availability permits.
The Phidget 1018 board is an interface board with 8 digital inputs, 8 digital outputs and 8 analog inputs. I have connected a small push button on a digital input and many Phidget analog sensors :
- 1112 Slider 60mm
- 1109 Rotation sensor
- 1103 IR-Reflective sensor
- 1121 Voltage divider with a LDR plugged in it
The 1112 and 1109 are simple potentiometers, the 1103 returns a value < 100 when an object is under 10cm from it and > 900 otherwise, the voltage divider provides an interface to non-Phidgets resistance sensors. With it, the LDR I’ve plugged in “sends” values between 0 and 1000, like other Phidget sensors.
I’ve created a Phidget1018 class that exports inputs values (both digitals and analogs), along with raw values for analog inputs if more accuracy is needed. Normal sensors value go from 0 to 1000 and raw values go from 0 to 4095.
Also, two user events are available : InputChange and SensorChange.
InputChange event is raised when the state of any of the digital inputs is changing, from either true to false or false to true. The event handler exposes two parameters to the user : Index and Value. Index represents the input that has changed (0…7) and Value contains its state (true or false)
SensorChange event is raised when the state of any of the analog inputs is changing. It is raised only if the change is greater than the Sensitivity property (which defaults to 10). Sensitivity can of course be changed in user code. Be aware though that with analog sensors, read values may change very quickly with only little amount of change, so you should not put small sensitivity values unless you know what you’re doing.
(move from wiki)