- Phidget Interfacekit 8/8/8 (like the 1018_2)
- Phidgets Rotation Sensor (like the 1116_0) and sensor cable
- 5 LEDs (any colour)
- Connector Wires
You’ll need both the Phidgets drivers and Max6 installed (and working) on your computer.
Phidgets drivers, libraries and installation instructions can be found here: http://cycling74.com/toolbox/phidgets-libraries-and-drivers/
Step 1: Setting Up the Hardware
Step 2: Connecting Phidgets to Max
For this tutorial, you can download and open the MaxPhidgetExample project to get started.
In the MaxPhidgetExample you’ll see a few different parts:
In box 2 lies the PhidgetInterfaceKit object. You can send the “getVersion”, “getStatus” and “getSerial” messages to check that your device and Max are talking (if they’re not, make sure that no other programs are connecting to your device). The start and stop messages will start and stop polling your device for input, and you can also set the sample rate, (100ms is the default and will work just fine for this example).
Underneath the PhidgetInterfaceKit object, in box 3, we “unpack” the inputs. We’re just going to be needing analog input 0 for this example, that’s where the rotation sensor is connected. We’re going to feed that data through some math expressions and then use that to set the rate of a metronome that will control the speed that the lights blink at. Over on the far right, you can also see we’re going to change the duration that the lights stay lit with this value so they stay on longer when the speed of them is slower.
That takes us to box 4. We’re going to light up each LED sequentially with a counter and gate. Then, using a subpatch called onoff, blink the light on and off. “onoff” simply sends two bangs to the toggle to turn it on and then off after a specified time. We then “pak” that message and send it to the Phidget Interface Kit for being output.
In box 1, at the very beginning, the “start disco” button sends signals to both the interface kit (to start or stop it from sampling the input) and also to the metronome (to start or stop signals from being sent to the lights).
Finally, box 5 visually displays the input signal.
Step 3: Making It Work
That’s the basics of connecting input and output to a Phidget Interface and using it in a Max patch. There are countless things you can do with the tools provided in Max and any of the Phidgets products. Have fun playing around and creating cool stuff.