diff --git a/GitHowTo.rtf b/GitHowTo.rtf new file mode 100644 index 0000000..8e8a17f --- /dev/null +++ b/GitHowTo.rtf @@ -0,0 +1,28 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf510 +{\fonttbl\f0\froman\fcharset0 Times-Roman;} +{\colortbl;\red255\green255\blue255;} +\margl1440\margr1440\vieww10800\viewh8400\viewkind0 +\deftab720 +\pard\pardeftab720 + +\f0\fs28 \cf0 I'll write it down so we can refer to this "how-to" in the future :-)\ +\ +Github is two things (1) an application on your mac, (2) a server on the web (were all the copies are synced)\ +\ +In order to get the most recent code, you need to follow these steps:\ +\ +A. Open the application on your mac\ +B. You will be presented with the interface - \'a0click "My Repositories" on the left bar menu\ +C. You will see a repo called "gauthiier/M-M-M" which you click on the arrow on the right.\ +D. This will bring you to the "Changes" mode of the repo (ilustrated on right bar).\ +E. Click on the "Sync Branch" on the top right of the repo window - this will fetch the code from the server.\ +F. If there is a problem fetching the code, this may be because you have un-commited code (code you worked on since we worked together). If this is the case, you simply need to commit your code by entering a "Commit summary" and by pressing the "Commit" button. After committing you can go to step E and "Sync Branch" again.\ +G. When the branch is in sync the code will be on your machine. To view wich version you have, simply click on "History" button in the right bar. The most recent code I've committed is entitled "Update Motion library and added an example how-to in apps folder".\ +H. To view where the code is on your computer, go back to "Changes" (button in the right bar) and the folder where the repo is placed on your computer should be displayed in a list (below the "Select All" checkbox)\ +\ +Let me know if you are still experiencing problems (and we will skype).\ +\ +Hope you are well Bill, and sunshine in Menlo Park! (here it is snowing, which is very nice :-)\ +\ +Daviid\ +} \ No newline at end of file diff --git a/hardware/supplies.rtf b/hardware/supplies.rtf new file mode 100644 index 0000000..842eb40 --- /dev/null +++ b/hardware/supplies.rtf @@ -0,0 +1,27 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf510 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\margl1440\margr1440\vieww14840\viewh6880\viewkind0 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural + +\f0\fs24 \cf0 list of supplies and suppliers --by bilver 4Nov12\ +\ +M&M&M board - CiiD Labs\ +Cables\ +- USB mini\ +- 10-conductor ribbon cable with IDC socket and headers\ +- audio mini-plug 3.5mm mono (stereo head-phones work)\ +Motors\ +- disk-drive head-positioner voice-coil motor (scavenged)\ +- motorized fader\ + mfg:\ + Penny & Giles - http://www.pennyandgiles.com/Audio-and-Video-Controllers-pg-27,2,,.php\ + Alps - http://www.alps.com/WebObjects/catalog.woa/E/HTML/Potentiometer/SlidePotentiometers/RSN1M/RSN1M_list.html\ + Sparkfun - https://www.sparkfun.com/products/10734\ +\ + distributors:\ + Sparkfun - https://www.sparkfun.com/products/10734\ + Digi-Key\ + Mouser\ + Jameco\ + Futurelec} \ No newline at end of file diff --git a/software/apps/Motion/CenterA/CenterA.ino b/software/apps/Motion/CenterA/CenterA.ino new file mode 100644 index 0000000..73896ed --- /dev/null +++ b/software/apps/Motion/CenterA/CenterA.ino @@ -0,0 +1,36 @@ +//Center +//uses a variable force (pwm duty) +//If it feels like a "mountain" - pushing away from center, then +//reverse the motor leads to make it feel like a "valley" +//or for a quick fix in the code: change if(f < 0) to if (f > 0) + +#include + +int pos; // position from analogRead +int force; // computed from pos and k +int k = 1; // spring constant +int duty; // pwm duty for Timer1 (range 0 - 1023) 10-bit resolution + +void setup() +{ + + MotorA.torque(100); //is this necessary? + +} + +void loop() +{ + + pos = analogRead(A3); + + force = k * (512 - pos); + duty = abs(force); + duty = min(511, duty); + + MotorA.torque(duty); + + if(force < 0) MotorA.direction(FORWARD); + else MotorA.direction(BACKWARD); + +} + diff --git a/software/apps/Motion/CenterB/CenterB.ino b/software/apps/Motion/CenterB/CenterB.ino new file mode 100644 index 0000000..d9a21f2 --- /dev/null +++ b/software/apps/Motion/CenterB/CenterB.ino @@ -0,0 +1,36 @@ +//Center +//uses a variable force (pwm duty) +//If it feels like a "mountain" - pushing away from center, then +//reverse the motor leads to make it feel like a "valley" +//or for a quick fix in the code: change if(f < 0) to if (f > 0) + +#include + +int pos; // position from analogRead +int force; // computed from pos and k +int k = 1; // spring constant +int duty; // pwm duty for Timer1 (range 0 - 1023) 10-bit resolution + +void setup() +{ + + MotorB.torque(100); //is this necessary? + +} + +void loop() +{ + + pos = analogRead(A3); + + force = k * (512 - pos); + duty = abs(force); + duty = min(1023, duty); + + MotorB.torque(duty); + + if(force < 0) MotorB.direction(FORWARD); + else MotorB.direction(BACKWARD); + +} + diff --git a/software/apps/Motion/Damp/Damp/Damp.ino b/software/apps/Motion/Damp using Velocity/Damp1/Damp1.ino similarity index 90% rename from software/apps/Motion/Damp/Damp/Damp.ino rename to software/apps/Motion/Damp using Velocity/Damp1/Damp1.ino index 5b4e94b..45c36b0 100644 --- a/software/apps/Motion/Damp/Damp/Damp.ino +++ b/software/apps/Motion/Damp using Velocity/Damp1/Damp1.ino @@ -1,6 +1,6 @@ //Damp - measure velocity then f=Bv #import -int x; //position measured +int x; //position measured - then filtered float v, f, t, xold; //velocity, force, time delta byte c; //for debug print every 256th loop diff --git a/software/apps/Motion/Damp2/Damp2.ino b/software/apps/Motion/Damp using Velocity/Damp2/Damp2.ino similarity index 100% rename from software/apps/Motion/Damp2/Damp2.ino rename to software/apps/Motion/Damp using Velocity/Damp2/Damp2.ino diff --git a/software/apps/Motion/Damp4/Damp4.ino b/software/apps/Motion/Damp using Velocity/DampK/DampK.ino similarity index 100% rename from software/apps/Motion/Damp4/Damp4.ino rename to software/apps/Motion/Damp using Velocity/DampK/DampK.ino diff --git a/software/apps/Motion/Damp3/DampMax.maxpat b/software/apps/Motion/Damp using Velocity/DiffDelayPlot.maxpat similarity index 100% rename from software/apps/Motion/Damp3/DampMax.maxpat rename to software/apps/Motion/Damp using Velocity/DiffDelayPlot.maxpat diff --git a/software/apps/Motion/Damp using Velocity/Graph2/Graph2.ino b/software/apps/Motion/Damp using Velocity/Graph2/Graph2.ino new file mode 100644 index 0000000..edd86b6 --- /dev/null +++ b/software/apps/Motion/Damp using Velocity/Graph2/Graph2.ino @@ -0,0 +1,28 @@ +int x, v, t; //position velocity time +#define n 10 +int xtab[n]; //table of x +int i; // index for table + +void setup() +{ + // start serial port at 9600 bps: + Serial.begin(9600); +} + +void loop() +{ + // if we get a valid byte, read analog ins: + if (Serial.available() > 0) { + x = analogRead(A0)/4; //just for this test + xtab[i] = x; //put it in array of x + i = i + 1; //index to last x (9 times ago) + if(i>9)i=0; //increment index + v = x - xtab[i]; //difference x vs old x + t = (t+1)%256; + // send sensor values: + Serial.write(x); // sends one byte [0-255] + Serial.write(v+128); + Serial.write(t); + } +} + diff --git a/software/apps/Motion/Damp using Velocity/Graph2/Graph2.maxpat b/software/apps/Motion/Damp using Velocity/Graph2/Graph2.maxpat new file mode 100644 index 0000000..6644143 --- /dev/null +++ b/software/apps/Motion/Damp using Velocity/Graph2/Graph2.maxpat @@ -0,0 +1,1460 @@ +{ + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 6, + "minor" : 0, + "revision" : 5 + } +, + "rect" : [ 122.0, 49.0, 1158.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" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-46", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 134.0, 690.0, 37.0, 21.0 ], + "text" : "v" + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-45", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 134.0, 591.0, 37.0, 21.0 ], + "text" : "x" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-42", + "maxclass" : "number", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 804.5, 499.0, 50.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-40", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 861.0, 459.0, 32.5, 20.0 ], + "text" : "* 8" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-39", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 861.0, 418.0, 38.0, 20.0 ], + "text" : "- 128" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-38", + "maxclass" : "number", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 804.5, 459.0, 50.0, 20.0 ] + } + + } +, { + "box" : { + "hint" : "x 186 y 210", + "id" : "obj-16", + "maxclass" : "itable", + "name" : "", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 157.0, 650.0, 706.0, 121.0 ], + "range" : 128, + "signed" : 1, + "size" : 255, + "table_data" : [ 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] + } + + } +, { + "box" : { + "hint" : "x 0 y 236", + "id" : "obj-5", + "maxclass" : "itable", + "name" : "", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 157.0, 551.0, 706.0, 114.0 ], + "range" : 255, + "size" : 255, + "table_data" : [ 0, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-41", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 6, + "minor" : 0, + "revision" : 5 + } +, + "rect" : [ 54.0, 94.0, 410.0, 385.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-6", + "linecount" : 4, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 212.0, 124.0, 166.0, 62.0 ], + "text" : "this subpacth filters out any residual ASCII 65 messages in the serial bufer from initial startup." + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-4", + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 187.0, 23.0, 25.0, 25.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "int" ], + "patching_rect" : [ 100.0, 212.0, 32.5, 20.0 ], + "text" : "t i 1" + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-2", + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 41.0, 334.0, 25.0, 25.0 ] + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-1", + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 76.0, 23.0, 25.0, 25.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-40", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 41.0, 145.0, 54.0, 20.0 ], + "text" : "gate 2 2" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-38", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "bang", "" ], + "patching_rect" : [ 76.0, 175.0, 43.0, 20.0 ], + "text" : "sel 65" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-40", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 109.5, 278.0, 50.5, 278.0 ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-40", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 123.0, 251.0, 182.0, 251.0, 182.0, 107.0, 50.5, 107.0 ], + "source" : [ "obj-3", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-38", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-40", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-4", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-40", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-38", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-40", 1 ] + } + + } + ], + "dependency_cache" : [ ] + } +, + "patching_rect" : [ 134.0, 352.0, 112.0, 20.0 ], + "saved_object_attributes" : { + "tags" : "", + "digest" : "", + "default_fontname" : "Arial", + "fontname" : "Arial", + "default_fontsize" : 12.0, + "description" : "", + "globalpatchername" : "", + "fontface" : 0, + "fontsize" : 12.0, + "default_fontface" : 0 + } +, + "text" : "p filter_extra_bytes" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-8", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 423.0, 65.0, 65.0, 20.0 ], + "text" : "closebang" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-7", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 355.0, 65.0, 60.0, 20.0 ], + "text" : "loadbang" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-37", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 726.0, 102.0, 207.0, 20.0 ], + "text" : "choose a serial port from this menu" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-28", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 695.0, 157.0, 79.0, 20.0 ], + "text" : "prepend port" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-4", + "items" : [ "Bluetooth-PDA-Sync", ",", "Bluetooth-Modem" ], + "maxclass" : "umenu", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "int", "", "" ], + "parameter_enable" : 0, + "patching_rect" : [ 604.0, 128.0, 200.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-32", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 604.0, 79.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" : [ 675.0, 45.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" : [ 604.0, 45.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" : [ 604.0, 12.0, 62.0, 20.0 ], + "text" : "route port" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-9", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 279.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" : [ 279.0, 332.0, 36.0, 20.0 ], + "text" : "sel 1" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-65", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 179.0, 404.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" : [ 117.0, 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" : [ 400.0, 250.0, 233.0, 75.0 ], + "text" : "checks for the ascii value of \"A\" to begin cominucation. 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" : "Arial", + "fontsize" : 12.0, + "id" : "obj-57", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "int" ], + "patching_rect" : [ 252.0, 273.0, 34.0, 20.0 ], + "text" : "t 2 0" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-55", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 325.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" : [ 325.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" : [ 325.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" : [ 134.0, 328.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" : [ 325.0, 275.0, 43.0, 20.0 ], + "text" : "sel 65" + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-35", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "" ], + "patching_rect" : [ 134.0, 399.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" : [ 475.0, 499.0, 37.0, 21.0 ], + "text" : "t" + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-3", + "maxclass" : "number", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 407.0, 499.0, 56.0, 21.0 ] + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-18", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 350.0, 500.0, 37.0, 21.0 ], + "text" : "v" + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-20", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 222.0, 500.0, 37.0, 21.0 ], + "text" : "x" + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-22", + "maxclass" : "number", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 282.0, 500.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" : [ 157.0, 500.0, 55.0, 21.0 ] + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-29", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "int", "int", "int" ], + "patching_rect" : [ 157.0, 465.0, 269.0, 21.0 ], + "text" : "unpack 0 0 0" + } + + } +, { + "box" : { + "fontname" : "Verdana", + "fontsize" : 12.0, + "id" : "obj-31", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 134.0, 375.0, 71.0, 21.0 ], + "text" : "zl group 3" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-30", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 3, + "outlettype" : [ "bang", "bang", "" ], + "patching_rect" : [ 252.0, 65.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" : [ 330.0, 156.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" : [ 355.0, 127.0, 227.0, 20.0 ], + "text" : "click here to open the selected serial port" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-21", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 282.0, 156.0, 39.0, 18.0 ], + "text" : "close" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-19", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 304.0, 127.0, 37.0, 18.0 ], + "text" : "open" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-2", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 375.0, 98.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" : [ 169.0, 20.0, 22.0, 22.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-12", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 169.0, 65.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" : [ 324.0, 98.0, 36.0, 18.0 ], + "text" : "print" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-14", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "" ], + "patching_rect" : [ 169.0, 210.0, 155.0, 20.0 ], + "text" : "serial a 9600 @autoopen 0" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-15", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 18.0, 57.0, 142.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" : [ 188.0, 20.0, 117.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-10", + "ignoreclick" : 1, + "maxclass" : "textbutton", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "int" ], + "parameter_enable" : 0, + "patching_rect" : [ 270.0, 20.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-25", + "ignoreclick" : 1, + "maxclass" : "textbutton", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "int" ], + "parameter_enable" : 0, + "patching_rect" : [ 706.0, 102.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-93", + "ignoreclick" : 1, + "maxclass" : "textbutton", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "int" ], + "parameter_enable" : 0, + "patching_rect" : [ 568.0, 98.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-12", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-11", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-30", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 178.5, 56.0, 261.5, 56.0 ], + "source" : [ "obj-11", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.168982, 0.8, 0.273315, 0.9 ], + "destination" : [ "obj-14", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 178.5, 147.0, 178.5, 147.0 ], + "source" : [ "obj-12", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.168982, 0.8, 0.273315, 0.9 ], + "destination" : [ "obj-14", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 333.5, 120.5, 178.5, 120.5 ], + "source" : [ "obj-13", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.004775, 0.8, 0.9 ], + "destination" : [ "obj-36", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 314.5, 231.0, 600.0, 231.0, 600.0, 9.0, 613.5, 9.0 ], + "source" : [ "obj-14", 1 ] + } + + } +, { + "patchline" : { + "color" : [ 0.740956, 0.137093, 0.8, 0.9 ], + "destination" : [ "obj-50", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-14", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.771514, 0.155069, 0.8, 0.9 ], + "destination" : [ "obj-54", 1 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 178.5, 237.0, 369.5, 237.0 ], + "source" : [ "obj-14", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.168982, 0.8, 0.273315, 0.9 ], + "destination" : [ "obj-14", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 313.5, 151.5, 178.5, 151.5 ], + "source" : [ "obj-19", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.168982, 0.8, 0.273315, 0.9 ], + "destination" : [ "obj-14", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 291.5, 185.5, 178.5, 185.5 ], + "source" : [ "obj-21", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-39", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-22", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-23", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.076581, 0.8, 0.10276, 0.9 ], + "destination" : [ "obj-14", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 704.5, 200.0, 178.5, 200.0 ], + "source" : [ "obj-28", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-22", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-29", 1 ] + } + + } +, { + "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", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-16", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "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" : [ 283.0, 111.0, 313.5, 111.0 ], + "source" : [ "obj-30", 1 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.0, 0.0, 0.9 ], + "destination" : [ "obj-21", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 261.5, 135.0, 291.5, 135.0 ], + "source" : [ "obj-30", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.0, 0.0, 0.9 ], + "destination" : [ "obj-57", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 261.5, 178.5, 261.5, 178.5 ], + "source" : [ "obj-30", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-35", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-31", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-32", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 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.168982, 0.8, 0.273315, 0.9 ], + "destination" : [ "obj-14", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 143.5, 437.0, 107.0, 437.0, 107.0, 195.0, 178.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-38", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-39", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-40", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-39", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-4", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-16", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-40", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-42", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-40", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-31", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-41", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-53", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-48", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-41", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-50", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-50", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 334.5, 321.0, 143.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" : [ 334.5, 326.5, 288.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" : [ 334.5, 354.0, 393.0, 354.0, 393.0, 246.0, 334.5, 246.0 ], + "source" : [ "obj-55", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-41", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-57", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-53", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 276.5, 296.0, 334.5, 296.0 ], + "source" : [ "obj-57", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.0, 0.0, 0.9 ], + "destination" : [ "obj-13", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 364.5, 87.0, 336.0, 87.0, 336.0, 93.0, 333.5, 93.0 ], + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.0, 0.0, 0.0, 1.0 ], + "destination" : [ "obj-21", 0 ], + "disabled" : 0, + "hidden" : 0, + "midpoints" : [ 432.5, 92.0, 309.0, 92.0, 309.0, 92.0, 291.5, 92.0 ], + "source" : [ "obj-8", 0 ] + } + + } +, { + "patchline" : { + "color" : [ 0.168982, 0.8, 0.273315, 0.9 ], + "destination" : [ "obj-14", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-9", 0 ] + } + + } + ], + "dependency_cache" : [ ] + } + +} diff --git a/software/apps/Motion/Damp using Velocity/HaywardFOAWvel.pdf b/software/apps/Motion/Damp using Velocity/HaywardFOAWvel.pdf new file mode 100644 index 0000000..21b763f Binary files /dev/null and b/software/apps/Motion/Damp using Velocity/HaywardFOAWvel.pdf differ diff --git a/software/apps/Motion/Damp using Velocity/VelocityPlot/VelocityPlot.ino b/software/apps/Motion/Damp using Velocity/VelocityPlot/VelocityPlot.ino new file mode 100644 index 0000000..ca711b0 --- /dev/null +++ b/software/apps/Motion/Damp using Velocity/VelocityPlot/VelocityPlot.ino @@ -0,0 +1,29 @@ +int x, v, t; //position velocity time +#define n 10 +int xtab[n]; //table of x +int i; // index for table + +void setup() +{ + // start serial port at 9600 bps: + Serial.begin(9600); +} + +void loop() +{ + // if we get a valid byte, read analog ins: + //if (Serial.available() > 0) { + x = analogRead(A0)/4; //just for this test + xtab[i] = x; //put it in array of x + i = i + 1; //index to last x (9 times ago) + if(i>9)i=0; //increment index + v = x - xtab[i]; //difference x vs old x + t = (t+1)%256; + // send sensor values: + Serial.print(x); // sends one byte [0-255] + Serial.print(","); + Serial.print(v+128); + Serial.print(","); + Serial.println(t); +} + diff --git a/software/apps/Motion/Damp3/Damp3.maxpat b/software/apps/Motion/Damp using Velocity/VelocityPlot/VelocityPlot.maxpat similarity index 73% rename from software/apps/Motion/Damp3/Damp3.maxpat rename to software/apps/Motion/Damp using Velocity/VelocityPlot/VelocityPlot.maxpat index 801debc..edbf85d 100644 --- a/software/apps/Motion/Damp3/Damp3.maxpat +++ b/software/apps/Motion/Damp using Velocity/VelocityPlot/VelocityPlot.maxpat @@ -7,7 +7,7 @@ "revision" : 5 } , - "rect" : [ 0.0, 44.0, 1280.0, 706.0 ], + "rect" : [ 350.0, 44.0, 901.0, 670.0 ], "bglocked" : 0, "openinpresentation" : 0, "default_fontsize" : 12.0, @@ -27,6 +27,55 @@ "digest" : "", "tags" : "", "boxes" : [ { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-42", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 826.0, 620.0, 38.0, 20.0 ], + "text" : "- 127" + } + + } +, { + "box" : { + "hint" : "x 186 y 210", + "id" : "obj-40", + "maxclass" : "itable", + "name" : "", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 128.0, 762.0, 706.0, 121.0 ], + "range" : 128, + "signed" : 1, + "size" : 255, + "table_data" : [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 2, 1, 0, 1, 1, 2, 1, 1, 2, 0, 1, 1, 1, 1, 0, 1, 2, 0, 1, 1, 1, 2, 1, 1, 1, 0, 2, 1, 1, 1, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 2, 1, 1, 1, 2, 2, 1, 1, 1, 0, 1, 1, 2, 0, 0, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 0, 0, 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] + } + + } +, { + "box" : { + "hint" : "x 0 y 236", + "id" : "obj-41", + "maxclass" : "itable", + "name" : "", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "parameter_enable" : 0, + "patching_rect" : [ 128.0, 663.0, 706.0, 114.0 ], + "range" : 255, + "size" : 255, + "table_data" : [ 0, 115, 115, 115, 115, 115, 115, 115, 115, 115, 116, 115, 115, 115, 115, 115, 115, 115, 115, 115, 116, 115, 115, 115, 115, 115, 115, 116, 115, 115, 115, 115, 116, 115, 115, 116, 115, 115, 115, 115, 115, 115, 115, 116, 115, 115, 115, 115, 116, 115, 115, 115, 115, 116, 115, 115, 115, 115, 115, 115, 115, 116, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 116, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 116, 115, 115, 115, 116, 116, 115, 115, 115, 115, 115, 115, 116, 115, 115, 115, 116, 115, 115, 116, 115, 116, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 116, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 116, 115, 115, 115, 115, 116, 115, 115, 115, 115, 115, 115, 115, 116, 115, 115, 115, 115, 115, 115, 115, 116, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 116, 115, 115, 115, 115, 115, 115, 115, 116, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 116, 116, 115, 115, 115, 115, 116, 115, 115, 115, 115, 115, 115, 115, 115, 115, 116, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 116, 115, 115, 115, 115, 115, 115, 115, 115, 115 ] + } + + } +, { "box" : { "fontname" : "Arial", "fontsize" : 12.0, @@ -114,7 +163,7 @@ "fontname" : "Arial", "fontsize" : 12.0, "id" : "obj-31", - "items" : [ "usbserial-AH01D7PO", ",", "Bluetooth-PDA-Sync", ",", "Bluetooth-Modem" ], + "items" : [ "usbserial-AH01D7PK", ",", "Bluetooth-PDA-Sync", ",", "Bluetooth-Modem" ], "maxclass" : "umenu", "numinlets" : 1, "numoutlets" : 3, @@ -265,20 +314,6 @@ "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" : { @@ -321,327 +356,6 @@ "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" : { @@ -724,17 +438,6 @@ "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" : { @@ -759,7 +462,7 @@ "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 449.0, 596.0, 37.0, 21.0 ], - "text" : "val3" + "text" : "t" } } @@ -786,7 +489,7 @@ "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 321.0, 596.0, 37.0, 21.0 ], - "text" : "val2" + "text" : "v" } } @@ -799,7 +502,7 @@ "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 193.0, 596.0, 37.0, 21.0 ], - "text" : "val1" + "text" : "x" } } @@ -1182,7 +885,7 @@ } , { "patchline" : { - "destination" : [ "obj-62", 1 ], + "destination" : [ "obj-42", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-22", 0 ] @@ -1191,7 +894,7 @@ } , { "patchline" : { - "destination" : [ "obj-62", 0 ], + "destination" : [ "obj-41", 1 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-23", 0 ] @@ -1249,7 +952,16 @@ } , { "patchline" : { - "destination" : [ "obj-62", 2 ], + "destination" : [ "obj-40", 0 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-41", 0 ], "disabled" : 0, "hidden" : 0, "source" : [ "obj-3", 0 ] @@ -1371,6 +1083,15 @@ "source" : [ "obj-4", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-40", 1 ], + "disabled" : 0, + "hidden" : 0, + "source" : [ "obj-42", 0 ] + } + } , { "patchline" : { @@ -1456,15 +1177,6 @@ "source" : [ "obj-6", 0 ] } - } -, { - "patchline" : { - "destination" : [ "obj-39", 0 ], - "disabled" : 0, - "hidden" : 0, - "source" : [ "obj-62", 0 ] - } - } , { "patchline" : { diff --git a/software/apps/Motion/Damp using Velocity/VelositySend/VelositySend.ino b/software/apps/Motion/Damp using Velocity/VelositySend/VelositySend.ino new file mode 100644 index 0000000..a398371 --- /dev/null +++ b/software/apps/Motion/Damp using Velocity/VelositySend/VelositySend.ino @@ -0,0 +1,41 @@ +// Velosity sends only one byte values + +int x, v, t; //position velocity time + +#define n 10 +int xtab[n]; //table of x +int i; // index for table + +void setup() +{ + // start serial port at 9600 bps: + Serial.begin(9600); + 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) { + x = analogRead(A0)/4; + xtab[i] = x; //put it in array of x + i = i + 1; //index to last x (9 times ago) + if(i>9)i=0; //increment index + v = x - xtab[i]; //difference x vs old x + t = (t+1)%256; + // send sensor values: + Serial.write(x); + Serial.write(","); + Serial.write(v+128); + Serial.write(","); + Serial.write(t); + } +} + +void establishContact() { + while (Serial.available() <= 0) { + Serial.println("0,0,0"); // send an initial string + delay(300); + } +} + diff --git a/software/apps/Motion/Damp3/Damp3/Damp3.ino b/software/apps/Motion/Damp3/Damp3/Damp3.ino deleted file mode 100644 index 9c5e0a3..0000000 --- a/software/apps/Motion/Damp3/Damp3/Damp3.ino +++ /dev/null @@ -1,48 +0,0 @@ - -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/DampEuler/DampEuler.ino b/software/apps/Motion/DampEuler/DampEuler.ino deleted file mode 100644 index 6926080..0000000 --- a/software/apps/Motion/DampEuler/DampEuler.ino +++ /dev/null @@ -1,24 +0,0 @@ -//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); -} - - - diff --git a/software/apps/Motion/DampMass/DampMass/DampMass.ino b/software/apps/Motion/DampMass/DampMass/DampMass.ino deleted file mode 100644 index 7fef7ab..0000000 --- a/software/apps/Motion/DampMass/DampMass/DampMass.ino +++ /dev/null @@ -1 +0,0 @@ -//DampMass diff --git a/software/apps/Motion/HelloApps.rtf b/software/apps/Motion/HelloApps.rtf new file mode 100644 index 0000000..058343b --- /dev/null +++ b/software/apps/Motion/HelloApps.rtf @@ -0,0 +1,26 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf510 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\margl1440\margr1440\vieww10800\viewh8400\viewkind0 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural + +\f0\fs24 \cf0 "Hello, World" Apps\ +\ +Wall (spring with and without damping) - how stiff without instability? - does damping help?\ +Center (full range of force and position) - \ +\ +Music -\ +position -> pitch (linear, non-linear)\ +gain -> FSR (second device?)\ +\ +Motor -\ +timed (open-loop) - "tick" "rumble" "\ + ramp - up,stay,dn,stay, etc.\ + rhythm - march, waltz, \'85\ +position - table/function (no time dependence) [ is this part of Motion?]\ +\ +Motion - \ +spring (position)\ +damping (velocity)\ +inertia (acceleration)\ +} \ No newline at end of file diff --git a/software/apps/Motion/PendulumMM_2/PendulumMM_2.ino b/software/apps/Motion/PendulumMM_2/PendulumMM_2.ino index b4f24ad..4f661d1 100644 --- a/software/apps/Motion/PendulumMM_2/PendulumMM_2.ino +++ b/software/apps/Motion/PendulumMM_2/PendulumMM_2.ino @@ -44,7 +44,7 @@ void loop(){ vf += ff*tf; xf += vf*tf; - if(c++==0) // when c gets to 255 it next == 0 and send data + if(c++==0) // when c gets to 255 it's next == 0 and sends data { Serial.print(x); Serial.print(" "); diff --git a/software/apps/Motion/SandFSR/SandFSR.ino b/software/apps/Motion/SandFSR/SandFSR.ino new file mode 100644 index 0000000..5a7f522 --- /dev/null +++ b/software/apps/Motion/SandFSR/SandFSR.ino @@ -0,0 +1,26 @@ +#include + +float pos, fin, finmax, fout; +byte c; // used as a counter from 0 to 255 +int duty; + +void setup(){ + digitalWrite(A4,HIGH); + digitalWrite(A5,LOW); + pinMode(A4, INPUT); + pinMode(A5, OUTPUT); + //MotorB._period(32); +} + +void loop(){ + fin += .01*(analogRead(A4)-fin); + fout = 0.5*fin*(1024+random(1024)); + duty = min(1024,fout); + duty = abs(duty); + //duty = min(duty,1024); + MotorB.torque(duty); + if(fout<0)MotorB.direction(FORWARD); + else MotorB.direction(BACKWARD); + } + + diff --git a/software/apps/Motor/motortest/motortest.ino b/software/apps/Motor/motortest/motortest.ino new file mode 100644 index 0000000..e315554 --- /dev/null +++ b/software/apps/Motor/motortest/motortest.ino @@ -0,0 +1,20 @@ +//motortest +//.5 sec forward, .5 sec back + +#include + +int led = 13; + +void setup() +{ + MotorA.torque(511); //what is max torque? + pinMode(13, OUTPUT); +} + +void loop() +{ + MotorA.direction(FORWARD); + delay(500); + MotorA.direction(BACKWARD); + delay(500); +} diff --git a/software/apps/Motor/postest/postest.ino b/software/apps/Motor/postest/postest.ino new file mode 100644 index 0000000..c260e55 --- /dev/null +++ b/software/apps/Motor/postest/postest.ino @@ -0,0 +1,14 @@ +//position +//sends A0 (MotorA), A3 (MotorB) to Serial Monitor + +void setup() +{ + Serial.begin(9600); +} + +void loop() +{ + Serial.print(analogRead(A3)); + Serial.print(" "); + Serial.println(analogRead(A0)); +} diff --git a/software/apps/Music/Minimal/Minimal.ino b/software/apps/Music/Minimal/Minimal.ino index 6511d20..a36503a 100644 --- a/software/apps/Music/Minimal/Minimal.ino +++ b/software/apps/Music/Minimal/Minimal.ino @@ -11,7 +11,7 @@ void setup() { // We initialise the sound engine by calling Music.init() which outputs a tone Music.init(); - Music.setSquare(); + Music.setSine(); }