diff --git a/software/apps/Motion/Damp/Damp/Damp.ino b/software/apps/Motion/Damp/Damp/Damp.ino index 97f16d6..5b4e94b 100644 --- a/software/apps/Motion/Damp/Damp/Damp.ino +++ b/software/apps/Motion/Damp/Damp/Damp.ino @@ -11,7 +11,7 @@ void setup(){ void loop(){ x = analogRead(A0); - v = x - xold; //lag v, too + v = x - xold; //lag v, too? xold += 0.1*(x-xold); //slide xold with lag if(c++==0){ diff --git a/software/apps/Motion/Damp3/Damp3.maxpat b/software/apps/Motion/Damp3/Damp3.maxpat new file mode 100644 index 0000000..801debc --- /dev/null +++ b/software/apps/Motion/Damp3/Damp3.maxpat @@ -0,0 +1,1502 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 6, + "minor" : 0, + "revision" : 5 + } +, + "rect" : [ 0.0, 44.0, 1280.0, 706.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" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-37", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 664.0, 115.0, 207.0, 20.0 ], + "text" : "choose a serial port from this menu" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-14", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "" ], + "patching_rect" : [ 140.0, 210.0, 155.0, 20.0 ], + "text" : "serial a 9600 @autoopen 0" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-21", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 233.0, 141.0, 39.0, 18.0 ], + "text" : "close" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-16", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 290.0, 29.0, 65.0, 20.0 ], + "text" : "closebang" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-24", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 359.0, 29.0, 60.0, 20.0 ], + "text" : "loadbang" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-28", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 633.0, 170.0, 79.0, 20.0 ], + "text" : "prepend port" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-31", + "items" : [ "usbserial-AH01D7PO", ",", "Bluetooth-PDA-Sync", ",", "Bluetooth-Modem" ], + "maxclass" : "umenu", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "int", "", "" ], + "parameter_enable" : 0, + "patching_rect" : [ 542.0, 141.0, 200.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-32", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 542.0, 92.0, 98.0, 20.0 ], + "text" : "prepend append" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-33", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "clear" ], + "patching_rect" : [ 613.0, 58.0, 43.0, 20.0 ], + "text" : "t clear" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-34", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 542.0, 58.0, 27.0, 20.0 ], + "text" : "iter" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-36", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 542.0, 25.0, 62.0, 20.0 ], + "text" : "route port" + } + + } +, { + "box" : { + "color" : [ 1.0, 0.890196, 0.090196, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-7", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 161.0, 465.0, 74.0, 20.0 ], + "text" : "fromsymbol" + } + + } +, { + "box" : { + "color" : [ 1.0, 0.890196, 0.090196, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-8", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 161.0, 442.0, 46.0, 20.0 ], + "text" : "itoa" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-4", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 161.0, 419.0, 53.0, 20.0 ], + "text" : "zl group" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-10", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 3, + "outlettype" : [ "bang", "bang", "" ], + "patching_rect" : [ 105.0, 381.0, 75.0, 20.0 ], + "text" : "select 10 13" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-9", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 250.0, 361.0, 32.5, 18.0 ], + "text" : "65" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "bang", "" ], + "patching_rect" : [ 250.0, 332.0, 36.0, 20.0 ], + "text" : "sel 1" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-5", + "linecount" : 13, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 411.0, 686.0, 540.0, 186.0 ], + "text" : "Serial Call-Response ASCII \n\nSends a byte out the serial port, and reads 3 ASCII enoded, comma separated in, truncated by a linefeed. It then sets foregound color, xpos, and ypos of a circle using the values returned from the serial port. \n\nNote: This patch assumes that the device on the other end of the serial port is going to send a single byte of value 65 (ASCII A) on startup. The sketch waits for that byte, then sends an ASCII A whenever it wants more data. \n\ncreated 14 Apr 2009\nby Scott Fitzgerald and Tom Igoe\nupdated 31 October 2011" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-65", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 150.0, 505.0, 425.0, 48.0 ], + "text" : "trigger (or [t]) forces right-left conventions. All the drawing and processing will happen before Max requests new values. When this trigger fires, it sends an ASCII A to ask Arduino for new values." + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-64", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 83.5, 273.0, 135.0, 34.0 ], + "text" : "reinitializes the gates when turned on and off" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-63", + "linecount" : 5, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 368.0, 231.0, 254.0, 75.0 ], + "text" : "checks for the ascii value of newline to begin communication. After initial communication is made, this block shuts down. A byte is sent back to the Arduino, indicating the patch is ready to receive information." + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 10.0, + "id" : "obj-62", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 6, + "minor" : 0, + "revision" : 5 + } +, + "rect" : [ 54.0, 94.0, 640.0, 480.0 ], + "bglocked" : 0, + "openinpresentation" : 0, + "default_fontsize" : 10.0, + "default_fontface" : 0, + "default_fontname" : "Verdana", + "gridonopen" : 0, + "gridsize" : [ 25.0, 25.0 ], + "gridsnaponopen" : 0, + "statusbarvisible" : 2, + "toolbarvisible" : 1, + "boxanimatetime" : 200, + "imprint" : 0, + "enablehscroll" : 1, + "enablevscroll" : 1, + "devicewidth" : 0.0, + "description" : "", + "digest" : "", + "tags" : "", + "boxes" : [ { + "box" : { + "fontname" : "Arial", + "fontsize" : 11.595187, + "id" : "obj-47", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 375.0, 150.0, 98.0, 18.0 ], + "text" : "frgb 255 255 255" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 11.595187, + "id" : "obj-46", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 275.0, 125.0, 59.0, 18.0 ], + "text" : "frgb 0 0 0" + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-45", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 3, + "outlettype" : [ "bang", "bang", "" ], + "patching_rect" : [ 300.0, 100.0, 66.0, 21.0 ], + "text" : "sel 255 0" + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-43", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 125.0, 180.0, 21.0 ], + "text" : "pack 0 0 0 0" + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-42", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 200.0, 100.0, 40.0, 21.0 ], + "text" : "+ 10" + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-41", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 75.0, 100.0, 40.0, 21.0 ], + "text" : "+ 10" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 11.595187, + "id" : "obj-40", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 50.0, 150.0, 152.0, 18.0 ], + "text" : "clear, paintoval $1 $2 $3 $4" + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-58", + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 57.5, 40.0, 25.0, 25.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-59", + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 120.0, 40.0, 25.0, 25.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-60", + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 300.0, 40.0, 25.0, 25.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-61", + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 228.333344, 228.0, 25.0, 25.0 ] + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-61", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-40", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-43", 2 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-41", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-43", 3 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-42", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-40", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-43", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-46", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-45", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-47", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-45", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-61", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-46", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-61", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-47", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-41", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-58", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-43", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-58", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-42", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-59", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-43", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-59", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-45", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-60", 0 ] + } + + } + ], + "dependency_cache" : [ ] + } +, + "patching_rect" : [ 128.0, 636.0, 269.0, 19.0 ], + "saved_object_attributes" : { + "fontface" : 0, + "fontsize" : 10.0, + "default_fontface" : 0, + "digest" : "", + "default_fontname" : "Verdana", + "fontname" : "Verdana", + "tags" : "", + "default_fontsize" : 10.0, + "description" : "", + "globalpatchername" : "" + } +, + "text" : "p \"draw the circle\"" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-57", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 223.0, 273.0, 32.5, 20.0 ], + "text" : "0" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-55", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 296.0, 331.0, 32.5, 20.0 ], + "text" : "!- 1" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-54", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 296.0, 250.0, 54.0, 20.0 ], + "text" : "gate 1 1" + } + + } +, { + "box" : { + "id" : "obj-53", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "parameter_enable" : 0, + "patching_rect" : [ 296.0, 300.0, 20.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-50", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 105.0, 350.0, 54.0, 20.0 ], + "text" : "gate 1 0" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-48", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "bang", "" ], + "patching_rect" : [ 296.0, 273.0, 43.0, 20.0 ], + "text" : "sel 10" + } + + } +, { + "box" : { + "id" : "obj-39", + "maxclass" : "lcd", + "numinlets" : 1, + "numoutlets" : 4, + "outlettype" : [ "list", "list", "int", "" ], + "patching_rect" : [ 128.0, 673.0, 1000.0, 1000.0 ] + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-35", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "" ], + "patching_rect" : [ 105.0, 504.0, 42.0, 21.0 ], + "text" : "t 65 l" + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-1", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 449.0, 596.0, 37.0, 21.0 ], + "text" : "val3" + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-3", + "maxclass" : "number", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 378.0, 596.0, 56.0, 21.0 ] + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-18", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 321.0, 596.0, 37.0, 21.0 ], + "text" : "val2" + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-20", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 193.0, 596.0, 37.0, 21.0 ], + "text" : "val1" + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-22", + "maxclass" : "number", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 253.0, 596.0, 56.0, 21.0 ] + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-23", + "maxclass" : "number", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 128.0, 596.0, 55.0, 21.0 ] + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-29", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 5, + "outlettype" : [ "int", "int", "int", "int", "int" ], + "patching_rect" : [ 128.0, 561.0, 269.0, 21.0 ], + "text" : "unpack 0 0 0 0 0" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-30", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 3, + "outlettype" : [ "bang", "bang", "" ], + "patching_rect" : [ 223.0, 50.0, 62.0, 20.0 ], + "text" : "select 0 1" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-26", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 281.0, 141.0, 206.0, 20.0 ], + "text" : "click here to close the serial port" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-27", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 306.0, 115.0, 206.0, 20.0 ], + "text" : "click here to open the serial port" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-19", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 255.0, 115.0, 37.0, 18.0 ], + "text" : "open" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-2", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 316.0, 85.0, 207.0, 20.0 ], + "text" : "Click here to get a list of serial ports" + } + + } +, { + "box" : { + "id" : "obj-11", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "parameter_enable" : 0, + "patching_rect" : [ 140.0, 5.0, 22.0, 22.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-12", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 140.0, 50.0, 65.0, 20.0 ], + "text" : "qmetro 10" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-13", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 275.0, 89.0, 36.0, 18.0 ], + "text" : "print" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-15", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 7.0, 50.0, 136.0, 34.0 ], + "text" : "Read serial input buffer every 10 milliseconds" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-17", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 167.0, 8.0, 79.0, 20.0 ], + "text" : "Click to start" + } + + } +, { + "box" : { + "background" : 1, + "bgcolor" : [ 1.0, 0.788235, 0.470588, 1.0 ], + "border" : 0, + "bordercolor" : [ 0.0, 0.0, 0.0, 1.0 ], + "fontface" : 1, + "fontname" : "Arial", + "fontsize" : 13.0, + "hint" : "", + "id" : "obj-38", + "ignoreclick" : 1, + "maxclass" : "textbutton", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "int" ], + "parameter_enable" : 0, + "patching_rect" : [ 640.0, 115.0, 20.0, 20.0 ], + "rounded" : 60.0, + "text" : "2", + "textcolor" : [ 0.34902, 0.34902, 0.34902, 1.0 ], + "textovercolor" : [ 0.2, 0.2, 0.2, 1.0 ] + } + + } +, { + "box" : { + "background" : 1, + "bgcolor" : [ 1.0, 0.788235, 0.470588, 1.0 ], + "border" : 0, + "bordercolor" : [ 0.0, 0.0, 0.0, 1.0 ], + "fontface" : 1, + "fontname" : "Arial", + "fontsize" : 13.0, + "hint" : "", + "id" : "obj-25", + "ignoreclick" : 1, + "maxclass" : "textbutton", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "int" ], + "parameter_enable" : 0, + "patching_rect" : [ 244.0, 8.0, 20.0, 20.0 ], + "rounded" : 60.0, + "text" : "3", + "textcolor" : [ 0.34902, 0.34902, 0.34902, 1.0 ], + "textovercolor" : [ 0.2, 0.2, 0.2, 1.0 ] + } + + } +, { + "box" : { + "background" : 1, + "bgcolor" : [ 1.0, 0.788235, 0.470588, 1.0 ], + "border" : 0, + "bordercolor" : [ 0.0, 0.0, 0.0, 1.0 ], + "fontface" : 1, + "fontname" : "Arial", + "fontsize" : 13.0, + "hint" : "", + "id" : "obj-93", + "ignoreclick" : 1, + "maxclass" : "textbutton", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "int" ], + "parameter_enable" : 0, + "patching_rect" : [ 512.0, 85.0, 20.0, 20.0 ], + "rounded" : 60.0, + "text" : "1", + "textcolor" : [ 0.34902, 0.34902, 0.34902, 1.0 ], + "textovercolor" : [ 0.2, 0.2, 0.2, 1.0 ] + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 170.5, 422.0, 170.5, 422.0 ], + "source" : [ "obj-10", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 114.5, 409.5, 170.5, 409.5 ], + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-12", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-11", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-30", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 149.5, 41.0, 232.5, 41.0 ], + "source" : [ "obj-11", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.057615, 0.8, 0.189809, 1.0 ], + "destination" : [ "obj-14", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-12", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.057615, 0.8, 0.189809, 1.0 ], + "destination" : [ "obj-14", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 284.5, 110.5, 149.5, 110.5 ], + "source" : [ "obj-13", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.106881, 0.233439, 0.8, 0.9 ], + "destination" : [ "obj-36", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 285.5, 231.0, 355.0, 231.0, 355.0, 171.0, 529.0, 171.0, 529.0, 105.0, 538.0, 105.0, 538.0, 21.0, 551.5, 21.0 ], + "source" : [ "obj-14", 1 ] + } + + } +, { + "patchline" : { + "color" : [ 0.586327, 0.12593, 0.8, 0.9 ], + "destination" : [ "obj-50", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-14", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.586327, 0.12593, 0.8, 0.9 ], + "destination" : [ "obj-54", 1 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 149.5, 237.0, 340.5, 237.0 ], + "source" : [ "obj-14", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.0, 0.0, 0.9 ], + "destination" : [ "obj-21", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 299.5, 76.0, 262.0, 76.0, 262.0, 76.0, 242.5, 76.0 ], + "source" : [ "obj-16", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.057615, 0.8, 0.189809, 1.0 ], + "destination" : [ "obj-14", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 264.5, 138.5, 149.5, 138.5 ], + "source" : [ "obj-19", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.057615, 0.8, 0.189809, 1.0 ], + "destination" : [ "obj-14", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 242.5, 159.0, 149.5, 159.0 ], + "source" : [ "obj-21", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-62", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-22", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-62", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-23", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.0, 0.0, 0.9 ], + "destination" : [ "obj-13", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 368.5, 79.0, 286.0, 79.0, 286.0, 84.0, 284.5, 84.0 ], + "source" : [ "obj-24", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.057615, 0.8, 0.189809, 1.0 ], + "destination" : [ "obj-14", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 642.5, 192.0, 149.5, 192.0 ], + "source" : [ "obj-28", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-22", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-29", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-23", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-29", 4 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-62", 2 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.0, 0.0, 0.9 ], + "destination" : [ "obj-19", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 254.0, 102.0, 264.5, 102.0 ], + "source" : [ "obj-30", 1 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.0, 0.0, 0.9 ], + "destination" : [ "obj-21", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 232.5, 126.0, 242.5, 126.0 ], + "source" : [ "obj-30", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.0, 0.0, 0.9 ], + "destination" : [ "obj-57", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 232.5, 171.0, 232.5, 171.0 ], + "source" : [ "obj-30", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-31", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-31", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-32", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-31", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-33", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-32", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-34", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.057615, 0.8, 0.189809, 1.0 ], + "destination" : [ "obj-14", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 114.5, 536.0, 78.0, 536.0, 78.0, 195.0, 149.5, 195.0 ], + "source" : [ "obj-35", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-35", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-33", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-36", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-34", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-36", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-4", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-53", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-48", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-10", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-50", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-50", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 305.5, 321.0, 114.5, 321.0 ], + "source" : [ "obj-53", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-55", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-53", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-6", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 305.5, 326.5, 259.5, 326.5 ], + "source" : [ "obj-53", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-48", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-54", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-54", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 305.5, 354.0, 364.0, 354.0, 364.0, 246.0, 305.5, 246.0 ], + "source" : [ "obj-55", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-53", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 232.5, 296.0, 305.5, 296.0 ], + "source" : [ "obj-57", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-39", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-62", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-35", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 170.5, 494.0, 114.5, 494.0 ], + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-8", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.057615, 0.8, 0.189809, 1.0 ], + "destination" : [ "obj-14", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-9", 0 ] + } + + } + ], + "dependency_cache" : [ ] + } + +} diff --git a/software/apps/Motion/Damp3/Damp3/Damp3.ino b/software/apps/Motion/Damp3/Damp3/Damp3.ino new file mode 100644 index 0000000..9c5e0a3 --- /dev/null +++ b/software/apps/Motion/Damp3/Damp3/Damp3.ino @@ -0,0 +1,48 @@ + +int firstSensor = 0; // first analog sensor +int secondSensor = 0; // second analog sensor +int thirdSensor = 0; // digital sensor +int inByte = 0; // incoming serial byte + +void setup() +{ + // start serial port at 9600 bps and wait for port to open: + Serial.begin(9600); + while (!Serial) { + ; // wait for serial port to connect. Needed for Leonardo only + } + + + pinMode(2, INPUT); // digital sensor is on digital pin 2 + establishContact(); // send a byte to establish contact until receiver responds +} + +void loop() +{ + // if we get a valid byte, read analog ins: + if (Serial.available() > 0) { + // get incoming byte: + inByte = Serial.read(); + // read first analog input: + firstSensor = analogRead(A0); + // read second analog input: + secondSensor = analogRead(A1); + // read switch, map it to 0 or 255L + thirdSensor = map(digitalRead(2), 0, 1, 0, 255); + // send sensor values: + Serial.print(firstSensor); + Serial.print(","); + Serial.print(secondSensor); + Serial.print(","); + Serial.println(thirdSensor); + } +} + +void establishContact() { + while (Serial.available() <= 0) { + Serial.println("0,0,0"); // send an initial string + delay(300); + } +} + + diff --git a/software/apps/Motion/Damp3/DampMax.maxpat b/software/apps/Motion/Damp3/DampMax.maxpat new file mode 100644 index 0000000..ff5ecb7 --- /dev/null +++ b/software/apps/Motion/Damp3/DampMax.maxpat @@ -0,0 +1,783 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 6, + "minor" : 0, + "revision" : 5 + } +, + "rect" : [ 25.0, 82.0, 1184.0, 641.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" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-36", + "maxclass" : "flonum", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "float", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 360.0, 393.0, 50.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-34", + "maxclass" : "number", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 229.0, 421.0, 50.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-32", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 289.0, 421.0, 32.5, 20.0 ], + "text" : "* 1" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-31", + "maxclass" : "flonum", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "float", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 289.0, 452.0, 50.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-29", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 289.0, 387.0, 32.5, 20.0 ], + "text" : "-" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-28", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 709.0, 345.0, 50.0, 18.0 ], + "text" : "76" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-26", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 649.0, 345.0, 50.0, 18.0 ], + "text" : "74" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-25", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 589.0, 345.0, 50.0, 18.0 ], + "text" : "71" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-24", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 529.0, 345.0, 50.0, 18.0 ], + "text" : "68" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-13", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 469.0, 345.0, 50.0, 18.0 ], + "text" : "66" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-3", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 409.0, 345.0, 50.0, 18.0 ], + "text" : "63" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-23", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 349.0, 345.0, 50.0, 18.0 ], + "text" : "61" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-1", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 289.0, 345.0, 50.0, 18.0 ], + "text" : "58" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-37", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 229.0, 345.0, 50.0, 18.0 ], + "text" : "57" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-27", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 10, + "outlettype" : [ "int", "bang", "bang", "bang", "bang", "bang", "bang", "bang", "bang", "bang" ], + "patching_rect" : [ 206.25, 306.0, 519.5, 20.0 ], + "text" : "t i b b b b b b b b b" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-22", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 5, + "outlettype" : [ "int", "bang", "bang", "bang", "bang" ], + "patching_rect" : [ 879.0, 313.0, 73.0, 20.0 ], + "text" : "t i b b b b" + } + + } +, { + "box" : { + "id" : "obj-21", + "maxclass" : "button", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 310.0, 6.0, 20.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-20", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 3, + "outlettype" : [ "bang", "bang", "int" ], + "patching_rect" : [ 325.0, 37.0, 56.0, 20.0 ], + "text" : "uzi 1024" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-19", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 41.0, 370.0, 37.0, 18.0 ], + "text" : "clear" + } + + } +, { + "box" : { + "id" : "obj-17", + "maxclass" : "button", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 292.0, 58.0, 20.0, 20.0 ] + } + + } +, { + "box" : { + "hint" : "x 82 y -44", + "id" : "obj-15", + "maxclass" : "itable", + "name" : "", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 150.0, 488.0, 1000.0, 145.0 ], + "range" : 128, + "signed" : 1, + "size" : 1024, + "table_data" : [ 0, 80, 4, 4, -32, -34, -36, -40, -40, -42, -50, -50, -18, -18, -22, -20, -20, -20, -16, -20, -20, -18, -14, -14, -16, -18, -22, -20, -18, -20, -18, -18, -18, -16, -14, -12, -6, -2, -2, 0, 4, 6, 8, 10, 6, 6, 6, 8, 6, 8, 8, 8, 10, 8, 8, 8, 8, 6, 8, 6, 6, 8, 8, 6, 6, 8, 6, 8, 6, 6, 6, 8, 8, 6, 8, 6, 6, 6, 6, 6, 6, 8, 6, 8, 8, 8, 8, 6, 8, 6, 8, 10, 10, 10, 10, 12, 12, 12, 10, 6, 8, 10, 10, 10, 8, 10, 12, 14, 14, 10, 10, 10, 10, 10, 8, 6, 6, 10, 10, 10, 12, 12, 12, 14, 12, 10, 10, 10, 10, 8, 8, 8, 8, 10, 10, 10, 8, 10, 12, 10, 10, 6, 8, 6, 8, 8, 6, 6, 8, 8, 8, 10, 8, 6, 8, 8, 6, 8, 10, 8, 10, 10, 10, 10, 12, 12, 10, 10, 10, 10, 10, 10, 8, 10, 8, 10, 10, 12, 12, 12, 14, 10, 12, 10, 8, 6, 6, 8, 6, 6, 6, 6, 8, 8, 8, 6, 6, 6, 6, 6, 4, 6, 6, 6, 6, 8, 6, 6, 6, 4, 0, -2, -4, -8, -10, -14, -18, -20, -20, -20, -20, -24, -22, -32, -36, -38, -44, -46, -50, -48, -50, -40, -32, -36, -32, -34, -34, -32, -38, -36, -38, -32, -30, -32, -32, -32, -24, -26, -26, -26, -26, -22, -22, -22, -24, -22, -22, -20, -18, -14, -8, -6, -4, -2, 0, 0, 2, 2, 4, 4, 4, 4, 4, 4, 2, 2, 0, 0, -2, -2, -2, -2, -2, -2, -2, -2, 0, 0, 0, 0, 0, -2, -2, -2, -2, -2, -2, -2, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 6, 2, 4, 4, 6, 6, 6, 6, 4, 4, 2, 2, 0, 0, 0, 0, 2, 2, 2, 4, 6, 146, 140, 134, 126, 116, 104, 102, 100, -38, -30, -24, -16, -4, 10, 12, 12, 12, 12, 12, 14, 12, 18, 22, 24, 22, 18, 14, 8, 2, -12, -20, -24, -28, -28, -26, -26, -22, -18, -22, -22, -18, -18, -14, -10, -4, 0, 10, -2, -14, -28, -38, -48, -54, -56, -66, -54, -50, -36, -32, -28, -26, -28, -22, -22, -14, -12, -6, -2, -2, 6, 6, 10, 10, 12, 12, 12, 12, 8, 10, 10, 10, 8, 6, 6, 6, 4, 2, 0, 0, 2, 2, 4, 6, 10, 18, 22, 26, 34, 36, 40, 40, 38, 28, 20, 12, 2, 0, -6, -8, -10, -8, -4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, -2, -2, -2, -2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 4, 6, 4, 4, 4, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -4, -4, -4, -4, -4, -6, -6, -4, -2, -2, -2, -2, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6, 6, 6, 6, 6, 6, 6, 6, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, -2, -2, -2, -2, -2, -2, -2, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, -2, -2, -4, -6, -4, -6, -8, -10, -12, -14, -16, -18, -26, -30, -34, -34, -34, -34, -34, -32, -24, -20, -18, -18, -18, -18, -14, -8, -6, 2, 8, 12, 26, 30, 40, 38, 40, 40, 40, 44, 34, 34, 26, 26, 24, 20, 20, 16, 16, 18, 18, 24, 26, 26, 34, 36, 46, 46, 44, 38, 36, 36, 26, 22, 10, 4, 0, -8, -12, -16, -26, -30, -34, -34, -30, -26, -30, -32, -26, -26, -26, -26, -28, -30, -26, -24, -22, -20, -20, -20, -20, -18, -20, -20, -22, -24, -22, -24, -28, -32, -28, -30, -30, -30, -30, -26, -20, -12, -8, 4, 16, 22, 26, 32, 38, 38, 36, 36, 30, 32, 32, 30, 34, 34, 34, 30, 32, 32, 40, 38, 30, 32, 36, 36, 40, 40, 30, 32, 34, 32, 28, 28, 20, 14, 12, 4, -4, -10, -20, -28, -38, -46, -48, -48, -46, -42, -38, -38, -34, -26, -26, -28, -32, -36, -38, -38, -38, -38, -42, -42, -36, -36, -32, -30, -26, -38, -32, -28, -36, -34, -32, -32, -30, -18, -18, -18, -12, -10, -12, -10, -10, -8, -6, -2, 2, 6, 10, 12, 16, 18, 20, 22, 24, 24, 26, 28, 28, 30, 32, 28, 28, 32, 30, 34, 32, 28, 24, 24, 20, 12, 10, 2, 0, 0, 0, 0, 0, -2, -2, -2, -2, -2, -2, -2, -2, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, -2, -2, -2, -2, 0, 2, 4, 4, 6, 6, 6, 6, 6, 4, 4, 4, 2, 2, 2, 2, 4, 4, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 4, 4, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-14", + "maxclass" : "number", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 150.0, 337.0, 50.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-12", + "maxclass" : "number", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 451.0, 92.0, 50.0, 20.0 ] + } + + } +, { + "box" : { + "id" : "obj-11", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "parameter_enable" : 0, + "patching_rect" : [ 451.0, -4.0, 20.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-9", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 451.0, 27.0, 51.0, 20.0 ], + "text" : "metro 1" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-8", + "maxclass" : "newobj", + "numinlets" : 5, + "numoutlets" : 4, + "outlettype" : [ "int", "", "", "int" ], + "patching_rect" : [ 451.0, 60.0, 101.0, 20.0 ], + "text" : "counter 0 1 1024" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-7", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 0, + "patching_rect" : [ 310.0, 96.0, 100.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-6", + "maxclass" : "number", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 150.0, 85.0, 50.0, 20.0 ] + } + + } +, { + "box" : { + "hint" : "x 79 y 127", + "id" : "obj-4", + "maxclass" : "itable", + "name" : "", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 150.0, 153.0, 1000.0, 145.0 ], + "range" : 128, + "size" : 1024, + "table_data" : [ 0, 56, 55, 54, 53, 51, 51, 50, 48, 48, 46, 45, 42, 41, 41, 40, 40, 38, 36, 36, 35, 34, 33, 31, 29, 28, 27, 26, 26, 25, 24, 23, 22, 22, 24, 25, 25, 25, 26, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 32, 32, 32, 33, 33, 33, 34, 34, 35, 36, 36, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 46, 47, 47, 48, 50, 50, 51, 51, 52, 53, 53, 53, 53, 54, 56, 56, 57, 57, 58, 59, 60, 61, 61, 61, 62, 62, 63, 63, 63, 64, 66, 66, 67, 68, 69, 69, 70, 70, 71, 71, 72, 73, 73, 73, 74, 74, 76, 76, 77, 77, 78, 79, 79, 79, 79, 80, 80, 81, 82, 82, 82, 83, 83, 84, 85, 85, 85, 86, 86, 86, 87, 89, 89, 90, 90, 91, 91, 92, 93, 94, 94, 95, 95, 96, 96, 96, 98, 98, 99, 100, 101, 102, 102, 103, 103, 104, 104, 104, 104, 105, 106, 106, 106, 107, 107, 108, 108, 109, 109, 109, 109, 110, 110, 110, 111, 112, 112, 112, 113, 113, 113, 113, 113, 112, 111, 110, 109, 108, 106, 104, 103, 102, 101, 100, 97, 97, 90, 86, 84, 80, 78, 75, 73, 72, 70, 70, 66, 64, 61, 58, 57, 53, 52, 51, 50, 49, 45, 42, 41, 41, 39, 38, 37, 36, 34, 31, 30, 29, 28, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 29, 29, 29, 29, 29, 29, 29, 30, 30, 31, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 33, 33, 33, 34, 35, 105, 102, 99, 96, 91, 85, 85, 85, 86, 87, 87, 88, 89, 90, 91, 91, 92, 93, 93, 95, 95, 99, 102, 103, 103, 102, 100, 99, 96, 93, 92, 91, 89, 88, 87, 86, 85, 84, 81, 80, 80, 79, 80, 81, 83, 84, 86, 79, 73, 65, 61, 57, 56, 56, 53, 52, 48, 47, 45, 43, 43, 42, 42, 41, 41, 41, 42, 42, 42, 45, 45, 46, 46, 47, 48, 48, 48, 49, 50, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 52, 52, 53, 54, 56, 60, 62, 64, 69, 70, 73, 74, 75, 74, 72, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, 70, 71, 71, 72, 72, 72, 73, 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 72, 72, 72, 72, 72, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 72, 74, 74, 74, 74, 74, 74, 74, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 73, 73, 73, 73, 73, 73, 72, 71, 71, 70, 69, 68, 67, 66, 64, 62, 58, 55, 52, 51, 50, 49, 47, 46, 46, 45, 43, 42, 41, 40, 40, 42, 43, 46, 47, 48, 54, 55, 60, 61, 63, 66, 67, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 81, 82, 86, 88, 89, 94, 96, 102, 104, 104, 105, 106, 107, 107, 107, 107, 106, 104, 101, 100, 99, 94, 92, 90, 89, 89, 88, 85, 83, 81, 79, 77, 76, 75, 73, 72, 71, 70, 69, 67, 66, 65, 64, 62, 61, 59, 57, 56, 54, 51, 48, 48, 46, 44, 42, 41, 41, 41, 42, 44, 48, 52, 53, 54, 57, 60, 61, 62, 66, 67, 69, 70, 72, 77, 78, 79, 81, 83, 85, 90, 91, 92, 94, 97, 99, 103, 105, 105, 107, 109, 110, 111, 113, 113, 112, 111, 109, 107, 105, 101, 99, 94, 89, 87, 85, 84, 84, 82, 80, 77, 76, 74, 71, 68, 66, 63, 61, 58, 57, 53, 50, 50, 48, 47, 46, 45, 38, 37, 36, 32, 31, 31, 30, 30, 29, 28, 27, 26, 26, 25, 25, 25, 25, 25, 26, 27, 29, 30, 31, 33, 34, 35, 37, 39, 41, 43, 45, 47, 49, 51, 51, 53, 57, 58, 62, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 64, 64, 64, 64, 64, 64, 64, 64, 65, 66, 66, 67, 67, 67, 67, 67, 67, 68, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 73 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-2", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 63.0, 39.0, 150.0, 20.0 ], + "text" : "Plot Velocity from Position" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-23", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-11", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-15", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-12", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-12", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-24", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-13", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-17", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-15", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-19", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-20", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-20", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-21", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-23", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-25", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-24", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-26", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-25", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-26", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-1", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-27", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-27", 5 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-23", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-27", 3 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-24", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-27", 6 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-25", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-27", 7 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-26", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-27", 8 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-27", 9 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-27", 4 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-37", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-27", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-37", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-27", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-28", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-32", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-34", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-15", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-31", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-31", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-32", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-32", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-36", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-1", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-37", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-37", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-14", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-4", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-27", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-4", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-12", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-8", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-9", 0 ] + } + + } + ], + "dependency_cache" : [ ] + } + +} diff --git a/software/apps/Motion/Damp4/Damp4.ino b/software/apps/Motion/Damp4/Damp4.ino new file mode 100644 index 0000000..7580ca8 --- /dev/null +++ b/software/apps/Motion/Damp4/Damp4.ino @@ -0,0 +1,20 @@ +//Damp3 trying integration to get velocity +// ala Kalman filtering? + +int x; //position measured [0-1023] +float af, vf //acceleration, velocity estimates +float ff // force out +float K = 1.0 //spring +float B = 10.0 //damping (dominant) +float M = 1.0 //mass + +void setup(){ + Serial.begin(115200); +} + +void loop(){ + x = analogRead(A0); + ff = K*(xf-x) - B*vf; // the spring K + af = ff/M; + vf += af*T; //T is cycle time + xf += vf*T; diff --git a/software/apps/Motion/DampEuler/DampEuler.ino b/software/apps/Motion/DampEuler/DampEuler.ino new file mode 100644 index 0000000..6926080 --- /dev/null +++ b/software/apps/Motion/DampEuler/DampEuler.ino @@ -0,0 +1,24 @@ +//Damp Euler + +#define n 10 //number in buffer "window size" +// finite difference with n samples between x(i) +int x[n]; //last n samples of position +int index = 0; +float v; // estimate of velocity +byte c; + +void setup(){ + Serial.begin(9600); + for(int i=0; i n-1) index = 0; + v = buff[index] - buff[(index-n)%n]; + if(c++==0)Serial.println(v); +} + + +