From 1630a593fe58fa09c85b09dd30ef3e599358f9e8 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Tue, 16 Feb 2010 11:43:51 -0700 Subject: [PATCH] adding documentation file --- .gitignore | 1 + ixm-collector.org | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 ixm-collector.org diff --git a/.gitignore b/.gitignore index 51a750b..a977cc2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.o sketch sketch.hex +*.html diff --git a/ixm-collector.org b/ixm-collector.org new file mode 100644 index 0000000..a9fe021 --- /dev/null +++ b/ixm-collector.org @@ -0,0 +1,75 @@ +#+TITLE: IXM collector +#+OPTIONS: num:nil ^:nil +#+LaTeX_CLASS: normal + +The collector is a small utility which can be included in your +sketches to allow printing directly back to a central observer +(probably your laptop) through a virtual face. The following example +sketch (included as =sketch.pde= in this repository) demonstrates it's +usage. + +#+begin_src c++ + /* -*- mode:C++ -*- + * + * Sketch description: Simple demonstration of the collector + * + * Sketch author: Eric Schulte + * + */ + #include "collector.h" // include the collector + int cface; // the virtual face assigned to the + // collector + int ledPin = 13; // LED connected to digital pin 13 + int wait; // a variable for the delay time + + void setup() { + cface = collector_init(); // initialize the collector and assign + // the virtual face + } + + void loop() { + wait = random(2000); // set wait to a random number + delay(wait); // wait for the assigned time + digitalWrite(ledPin, LOW); // sets the LED on + // print to the collector face and the result will be automatically + // routed to your laptop + facePrintf(cface, "waited %d miliseconds\n", wait); + delay(500); // wait for the assigned time + digitalWrite(ledPin, HIGH); // sets the LED off + } +#+end_src + +Once this sketch has burned to your boards, you send a =c=-packet +(=c2= in the example below) telling your boards that you will be the +collector. Each =c=-packet should contain a number -- boards keep +track of the highest =c=-number they have received and will ignore any +=c=-packets with lower numbers. Once the boards receive this +=c=-packet their collector face will be connected to the sender of the +=c=-packet. this is should in the following output of the above +example =sketch.pde=. + +#+begin_example + Ln 11.602 [Sending checksum South for 0x10014+32748=AAD8E8E5-86FBCC66] + Ln 16.257 [Sending checksum North for 0x18000+12204=A3E9651E-194595F0] + Ln 17.953 [Sending checksum South for 0x18000+12204=A3E9651E-194595F0] + Ln 19.283 [North burned successfully!] + Ln 20.985 [South burned successfully!] + c2 + (-1,1) waited 1349 miliseconds + (0,0) waited 3888 miliseconds + (1,-1) waited 2374 miliseconds + (1,0) waited 4205 miliseconds + (-1,-1) waited 2570 miliseconds + (1,1) waited 2540 miliseconds + (-1,0) waited 3334 miliseconds + (1,1) waited 1485 miliseconds + (0,0) waited 2455 miliseconds + (-1,1) waited 4452 miliseconds + (-1,-1) waited 3534 miliseconds + (1,0) waited 3948 miliseconds + (1,-1) waited 4650 miliseconds + (1,-1) waited 430 miliseconds + (-1,0) waited 4916 miliseconds + (1,-1) waited 464 miliseconds + (0,0) waited 3712 miliseconds +#+end_example -- 2.11.4.GIT