{ "patcher" : { "fileversion" : 1, "appversion" : { "major" : 6, "minor" : 0, "revision" : 4 } , "rect" : [ 99.0, 108.0, 767.0, 582.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, "default_fontface" : 0, "default_fontname" : "Arial", "gridonopen" : 0, "gridsize" : [ 15.0, 15.0 ], "gridsnaponopen" : 0, "statusbarvisible" : 2, "toolbarvisible" : 1, "boxanimatetime" : 200, "imprint" : 0, "enablehscroll" : 1, "enablevscroll" : 1, "devicewidth" : 0.0, "description" : "", "digest" : "", "tags" : "", "boxes" : [ { "box" : { "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-54", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 676.0, 495.0, 59.0, 34.0 ], "presentation_rect" : [ 672.0, 488.0, 0.0, 0.0 ], "text" : "ANALOG INPUT" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-52", "linecount" : 9, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 570.0, 345.0, 154.0, 131.0 ], "text" : "When you turn the potentiometer attached to the first analog input, it sends a value between 0 and 1000 to the leftmost flonum and attached dial. The range of the dial has been set to 1000 to match the incoming values." } } , { "box" : { "id" : "obj-50", "maxclass" : "dial", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "float" ], "parameter_enable" : 0, "patching_rect" : [ 467.0, 405.0, 75.0, 75.0 ], "presentation_rect" : [ 447.0, 393.0, 0.0, 0.0 ], "size" : 1000.0 } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-49", "maxclass" : "flonum", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "float", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 467.0, 375.0, 50.0, 20.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-47", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "int", "int" ], "patching_rect" : [ 375.0, 345.0, 69.0, 20.0 ], "presentation_rect" : [ 454.0, 328.0, 0.0, 0.0 ], "text" : "unpack 0 0" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-46", "maxclass" : "flonum", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "float", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 375.0, 375.0, 50.0, 20.0 ] } } , { "box" : { "id" : "obj-44", "maxclass" : "dial", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "float" ], "parameter_enable" : 0, "patching_rect" : [ 375.0, 405.0, 75.0, 75.0 ], "size" : 1000.0 } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-42", "linecount" : 5, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 45.0, 345.0, 142.0, 75.0 ], "text" : "If you press the physical switch attached to the first digital input, the leftmost of these led objects should light up" } } , { "box" : { "id" : "obj-40", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 260.0, 375.0, 45.0, 45.0 ], "presentation_rect" : [ 257.0, 361.0, 0.0, 0.0 ] } } , { "box" : { "id" : "obj-39", "maxclass" : "led", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 210.0, 375.0, 45.0, 45.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-38", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "int", "int" ], "patching_rect" : [ 210.0, 345.0, 69.0, 20.0 ], "text" : "unpack 0 0" } } , { "box" : { "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-37", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 45.0, 495.0, 59.0, 34.0 ], "presentation_rect" : [ 49.0, 334.0, 0.0, 0.0 ], "text" : "DIGITAL INPUT" } } , { "box" : { "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-36", "linecount" : 2, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 676.0, 90.0, 59.0, 34.0 ], "text" : "DIGITAL OUTPUT" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-34", "linecount" : 5, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 570.0, 195.0, 165.0, 75.0 ], "text" : "We can also construct the setoutput messages with the code above. Set and unset the first toggle to turn the physical LED on and off." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-32", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 285.0, 120.0, 34.0, 18.0 ], "text" : "start" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-28", "linecount" : 6, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 375.0, 195.0, 167.0, 89.0 ], "text" : "Sending the message 'setoutput 1 0' will turn on the first digital output (and the physical LED). The message 'setoutput 0 0' will turn off the first digital output." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-26", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 405.0, 121.0, 80.0, 18.0 ], "text" : "setoutput 0 0" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-24", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 405.0, 91.0, 80.0, 18.0 ], "text" : "setoutput 1 0" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-21", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 570.0, 150.0, 107.0, 20.0 ], "text" : "prepend setoutput" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-20", "maxclass" : "newobj", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 570.0, 120.0, 50.0, 20.0 ], "text" : "pak 0 0" } } , { "box" : { "id" : "obj-19", "maxclass" : "toggle", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 601.0, 90.0, 20.0, 20.0 ] } } , { "box" : { "id" : "obj-17", "maxclass" : "toggle", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "int" ], "parameter_enable" : 0, "patching_rect" : [ 570.0, 90.0, 20.0, 20.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-13", "linecount" : 12, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 45.0, 91.0, 139.0, 172.0 ], "text" : "If your Phidgets InterfaceKit is set up correctly, it will respond with the value 1 when you send the message 'getStatus', and with a serial number when you send 'getSerial'.\n\nSend the message 'start' to begin receiving information from it." } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-11", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 210.0, 121.0, 58.0, 18.0 ], "text" : "getSerial" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-9", "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 210.0, 91.0, 61.0, 18.0 ], "text" : "getStatus" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-7", "maxclass" : "number", "numinlets" : 1, "numoutlets" : 2, "outlettype" : [ "int", "bang" ], "parameter_enable" : 0, "patching_rect" : [ 254.0, 255.0, 76.0, 20.0 ] } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-5", "maxclass" : "newobj", "numinlets" : 3, "numoutlets" : 3, "outlettype" : [ "", "", "" ], "patching_rect" : [ 210.0, 225.0, 63.0, 20.0 ], "text" : "route di ai" } } , { "box" : { "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-4", "maxclass" : "newobj", "numinlets" : 1, "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 210.0, 195.0, 112.0, 20.0 ], "text" : "PhidgetInterfaceKit" } } , { "box" : { "bubble" : 1, "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-2", "linecount" : 3, "maxclass" : "comment", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 15.0, 15.0, 495.0, 52.0 ], "text" : "Analog input, digital input and digital output with the Phidgets 2/2/2 InterfaceKit in Max 6\nWilliam J Turkel\nhttp://williamjturkel.net/code" } } , { "box" : { "background" : 1, "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], "border" : 1, "id" : "obj-53", "ignoreclick" : 1, "maxclass" : "panel", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 360.0, 326.0, 390.0, 214.0 ], "presentation_rect" : [ 355.0, 311.0, 0.0, 0.0 ], "rounded" : 30 } } , { "box" : { "background" : 1, "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], "border" : 1, "id" : "obj-43", "ignoreclick" : 1, "maxclass" : "panel", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 326.0, 315.0, 214.0 ], "presentation_rect" : [ 37.0, 311.0, 0.0, 0.0 ], "rounded" : 30 } } , { "box" : { "background" : 1, "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], "border" : 1, "id" : "obj-30", "ignoreclick" : 1, "maxclass" : "panel", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 75.0, 315.0, 225.0 ], "presentation_rect" : [ 31.0, 77.0, 0.0, 0.0 ], "rounded" : 30 } } , { "box" : { "background" : 1, "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], "border" : 1, "id" : "obj-29", "ignoreclick" : 1, "maxclass" : "panel", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 360.0, 75.0, 390.0, 225.0 ], "presentation_rect" : [ 358.0, 76.0, 0.0, 0.0 ], "rounded" : 30 } } , { "box" : { "background" : 1, "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], "border" : 1, "id" : "obj-23", "ignoreclick" : 1, "maxclass" : "panel", "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 30.0, 75.0, 315.0, 210.0 ], "rounded" : 30 } } ], "lines" : [ { "patchline" : { "destination" : [ "obj-4", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 219.5, 141.0, 219.5, 141.0 ], "source" : [ "obj-11", 0 ] } } , { "patchline" : { "destination" : [ "obj-20", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-17", 0 ] } } , { "patchline" : { "destination" : [ "obj-20", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-19", 0 ] } } , { "patchline" : { "destination" : [ "obj-21", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-20", 0 ] } } , { "patchline" : { "destination" : [ "obj-4", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 579.5, 180.0, 219.5, 180.0 ], "source" : [ "obj-21", 0 ] } } , { "patchline" : { "destination" : [ "obj-4", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 414.5, 111.0, 394.0, 111.0, 394.0, 165.0, 219.5, 165.0 ], "source" : [ "obj-24", 0 ] } } , { "patchline" : { "destination" : [ "obj-4", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 414.5, 165.0, 219.5, 165.0 ], "source" : [ "obj-26", 0 ] } } , { "patchline" : { "destination" : [ "obj-4", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 294.5, 151.0, 219.5, 151.0 ], "source" : [ "obj-32", 0 ] } } , { "patchline" : { "destination" : [ "obj-39", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-38", 0 ] } } , { "patchline" : { "destination" : [ "obj-40", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-38", 1 ] } } , { "patchline" : { "destination" : [ "obj-5", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-4", 0 ] } } , { "patchline" : { "destination" : [ "obj-44", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-46", 0 ] } } , { "patchline" : { "destination" : [ "obj-46", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-47", 0 ] } } , { "patchline" : { "destination" : [ "obj-49", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-47", 1 ] } } , { "patchline" : { "destination" : [ "obj-50", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-49", 0 ] } } , { "patchline" : { "destination" : [ "obj-38", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-5", 0 ] } } , { "patchline" : { "destination" : [ "obj-47", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 241.5, 313.0, 357.0, 313.0, 357.0, 313.0, 384.5, 313.0 ], "source" : [ "obj-5", 1 ] } } , { "patchline" : { "destination" : [ "obj-7", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-5", 2 ] } } , { "patchline" : { "destination" : [ "obj-4", 0 ], "disabled" : 0, "hidden" : 0, "midpoints" : [ 219.5, 111.0, 195.0, 111.0, 195.0, 165.0, 219.5, 165.0 ], "source" : [ "obj-9", 0 ] } } ], "dependency_cache" : [ { "name" : "PhidgetInterfaceKit.mxo", "type" : "iLaX" } ] } }