Just in case anyone's curious, here's how the problem was solved. The
task, if you recall, was independent control of 10 blinking LEDs from
the digital outs of the Arduino. I ditched the Firmata and used some
basic Arduino example code instead. LEDs draw about 8.5 mA each in the
end (using Kingbright ultra bright reds with 330R resistor) so it's
quite safe to run the whole thing from USB power even.
Arduino code and test patch attached.
best!
Derek
int val;
void setup()
{
Serial.begin(115200);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
}
void loop()
{
if (Serial.available()) {
val = Serial.read();
switch (val) {
case 2:
digitalWrite(2, HIGH);
break;
case 3:
digitalWrite(3, HIGH);
break;
case 4:
digitalWrite(4, HIGH);
break;
case 5:
digitalWrite(5, HIGH);
break;
case 6:
digitalWrite(6, HIGH);
break;
case 7:
digitalWrite(7, HIGH);
break;
case 8:
digitalWrite(8, HIGH);
break;
case 9:
digitalWrite(9, HIGH);
break;
case 10:
digitalWrite(10, HIGH);
break;
case 11:
digitalWrite(11, HIGH);
break;
case 12:
digitalWrite(2, LOW);
break;
case 13:
digitalWrite(3, LOW);
break;
case 14:
digitalWrite(4, LOW);
break;
case 15:
digitalWrite(5, LOW);
break;
case 16:
digitalWrite(6, LOW);
break;
case 17:
digitalWrite(7, LOW);
break;
case 18:
digitalWrite(8, LOW);
break;
case 19:
digitalWrite(9, LOW);
break;
case 20:
digitalWrite(10, LOW);
break;
case 21:
digitalWrite(11, LOW);
break;
}
}
}
--
derek holzer :::
http://www.umatic.nl :::
http://blog.myspace.com/macumbista
---Oblique Strategy # 39:
"Cut a vital connection"
#N canvas -63 540 1213 650 10;
#X msg 243 231 close;
#X msg 190 245 open 3;
#X obj 190 311 comport 3 115200;
#X obj 398 95 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 1
1;
#X obj 449 73 random 200;
#X obj 449 100 + 200;
#X floatatom 468 130 5 0 0 0 - - -;
#X obj 449 50 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144 -1
-1;
#X obj 398 164 f;
#X obj 430 164 + 1;
#X obj 398 187 mod 2;
#X msg 398 261 2;
#X msg 426 286 12;
#X obj 398 235 select 0 1;
#X obj 398 129 metro 400;
#X obj 528 95 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 1
1;
#X obj 579 73 random 200;
#X obj 579 100 + 200;
#X floatatom 598 130 5 0 0 0 - - -;
#X obj 579 50 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144 -1
-1;
#X obj 528 164 f;
#X obj 560 164 + 1;
#X obj 528 187 mod 2;
#X obj 528 235 select 0 1;
#X obj 528 129 metro 400;
#X obj 678 95 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 1
1;
#X obj 729 73 random 200;
#X obj 729 100 + 200;
#X floatatom 748 130 5 0 0 0 - - -;
#X obj 729 50 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144 -1
-1;
#X obj 678 164 f;
#X obj 710 164 + 1;
#X obj 678 187 mod 2;
#X obj 678 235 select 0 1;
#X obj 678 129 metro 400;
#X obj 808 95 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 1
1;
#X obj 859 73 random 200;
#X obj 859 100 + 200;
#X floatatom 878 130 5 0 0 0 - - -;
#X obj 859 50 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144 -1
-1;
#X obj 808 164 f;
#X obj 840 164 + 1;
#X obj 808 187 mod 2;
#X obj 808 235 select 0 1;
#X obj 808 129 metro 400;
#X obj 948 95 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 1
1;
#X obj 999 73 random 200;
#X obj 999 100 + 200;
#X floatatom 1018 130 5 0 0 0 - - -;
#X obj 999 50 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144 -1
-1;
#X obj 948 164 f;
#X obj 980 164 + 1;
#X obj 948 187 mod 2;
#X obj 948 235 select 0 1;
#X obj 948 129 metro 400;
#X obj 398 375 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 1
1;
#X obj 449 353 random 200;
#X obj 449 380 + 200;
#X floatatom 468 410 5 0 0 0 - - -;
#X obj 449 330 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144
-1 -1;
#X obj 398 444 f;
#X obj 430 444 + 1;
#X obj 398 467 mod 2;
#X obj 398 515 select 0 1;
#X obj 398 409 metro 400;
#X obj 528 375 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 1
1;
#X obj 579 353 random 200;
#X obj 579 380 + 200;
#X floatatom 598 410 5 0 0 0 - - -;
#X obj 579 330 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144
-1 -1;
#X obj 528 444 f;
#X obj 560 444 + 1;
#X obj 528 467 mod 2;
#X obj 528 515 select 0 1;
#X obj 528 409 metro 400;
#X obj 678 375 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 1
1;
#X obj 729 353 random 200;
#X obj 729 380 + 200;
#X floatatom 748 410 5 0 0 0 - - -;
#X obj 729 330 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144
-1 -1;
#X obj 678 444 f;
#X obj 710 444 + 1;
#X obj 678 467 mod 2;
#X obj 678 515 select 0 1;
#X obj 678 409 metro 400;
#X obj 808 375 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 1
1;
#X obj 859 353 random 200;
#X obj 859 380 + 200;
#X floatatom 878 410 5 0 0 0 - - -;
#X obj 859 330 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144
-1 -1;
#X obj 808 444 f;
#X obj 840 444 + 1;
#X obj 808 467 mod 2;
#X obj 808 515 select 0 1;
#X obj 808 409 metro 400;
#X obj 948 375 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 1
1;
#X obj 999 353 random 200;
#X obj 999 380 + 200;
#X floatatom 1018 410 5 0 0 0 - - -;
#X obj 999 330 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144
-1 -1;
#X obj 948 444 f;
#X obj 980 444 + 1;
#X obj 948 467 mod 2;
#X obj 948 515 select 0 1;
#X obj 948 409 metro 400;
#X msg 528 261 3;
#X msg 556 286 13;
#X msg 678 261 4;
#X msg 706 286 14;
#X msg 808 261 5;
#X msg 836 286 15;
#X msg 948 261 6;
#X msg 976 286 16;
#X msg 398 541 7;
#X msg 426 566 17;
#X msg 528 541 8;
#X msg 556 566 18;
#X msg 678 541 9;
#X msg 706 566 19;
#X msg 808 541 10;
#X msg 836 566 20;
#X msg 948 541 11;
#X msg 976 565 21;
#X connect 0 0 2 0;
#X connect 1 0 2 0;
#X connect 3 0 14 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X connect 5 0 14 1;
#X connect 7 0 4 0;
#X connect 8 0 9 0;
#X connect 8 0 10 0;
#X connect 9 0 8 1;
#X connect 10 0 13 0;
#X connect 11 0 2 0;
#X connect 12 0 2 0;
#X connect 13 0 11 0;
#X connect 13 1 12 0;
#X connect 14 0 8 0;
#X connect 15 0 24 0;
#X connect 16 0 17 0;
#X connect 17 0 18 0;
#X connect 17 0 24 1;
#X connect 19 0 16 0;
#X connect 20 0 21 0;
#X connect 20 0 22 0;
#X connect 21 0 20 1;
#X connect 22 0 23 0;
#X connect 23 0 105 0;
#X connect 23 1 106 0;
#X connect 24 0 20 0;
#X connect 25 0 34 0;
#X connect 26 0 27 0;
#X connect 27 0 28 0;
#X connect 27 0 34 1;
#X connect 29 0 26 0;
#X connect 30 0 31 0;
#X connect 30 0 32 0;
#X connect 31 0 30 1;
#X connect 32 0 33 0;
#X connect 33 0 107 0;
#X connect 33 1 108 0;
#X connect 34 0 30 0;
#X connect 35 0 44 0;
#X connect 36 0 37 0;
#X connect 37 0 38 0;
#X connect 37 0 44 1;
#X connect 39 0 36 0;
#X connect 40 0 41 0;
#X connect 40 0 42 0;
#X connect 41 0 40 1;
#X connect 42 0 43 0;
#X connect 43 0 109 0;
#X connect 43 1 110 0;
#X connect 44 0 40 0;
#X connect 45 0 54 0;
#X connect 46 0 47 0;
#X connect 47 0 48 0;
#X connect 47 0 54 1;
#X connect 49 0 46 0;
#X connect 50 0 51 0;
#X connect 50 0 52 0;
#X connect 51 0 50 1;
#X connect 52 0 53 0;
#X connect 53 0 111 0;
#X connect 53 1 112 0;
#X connect 54 0 50 0;
#X connect 55 0 64 0;
#X connect 56 0 57 0;
#X connect 57 0 58 0;
#X connect 57 0 64 1;
#X connect 59 0 56 0;
#X connect 60 0 61 0;
#X connect 60 0 62 0;
#X connect 61 0 60 1;
#X connect 62 0 63 0;
#X connect 63 0 113 0;
#X connect 63 1 114 0;
#X connect 64 0 60 0;
#X connect 65 0 74 0;
#X connect 66 0 67 0;
#X connect 67 0 68 0;
#X connect 67 0 74 1;
#X connect 69 0 66 0;
#X connect 70 0 71 0;
#X connect 70 0 72 0;
#X connect 71 0 70 1;
#X connect 72 0 73 0;
#X connect 73 0 115 0;
#X connect 73 1 116 0;
#X connect 74 0 70 0;
#X connect 75 0 84 0;
#X connect 76 0 77 0;
#X connect 77 0 78 0;
#X connect 77 0 84 1;
#X connect 79 0 76 0;
#X connect 80 0 81 0;
#X connect 80 0 82 0;
#X connect 81 0 80 1;
#X connect 82 0 83 0;
#X connect 83 0 117 0;
#X connect 83 1 118 0;
#X connect 84 0 80 0;
#X connect 85 0 94 0;
#X connect 86 0 87 0;
#X connect 87 0 88 0;
#X connect 87 0 94 1;
#X connect 89 0 86 0;
#X connect 90 0 91 0;
#X connect 90 0 92 0;
#X connect 91 0 90 1;
#X connect 92 0 93 0;
#X connect 93 0 119 0;
#X connect 93 1 120 0;
#X connect 94 0 90 0;
#X connect 95 0 104 0;
#X connect 96 0 97 0;
#X connect 97 0 98 0;
#X connect 97 0 104 1;
#X connect 99 0 96 0;
#X connect 100 0 101 0;
#X connect 100 0 102 0;
#X connect 101 0 100 1;
#X connect 102 0 103 0;
#X connect 103 0 121 0;
#X connect 103 1 122 0;
#X connect 104 0 100 0;
#X connect 105 0 2 0;
#X connect 106 0 2 0;
#X connect 107 0 2 0;
#X connect 108 0 2 0;
#X connect 109 0 2 0;
#X connect 110 0 2 0;
#X connect 111 0 2 0;
#X connect 112 0 2 0;
#X connect 113 0 2 0;
#X connect 114 0 2 0;
#X connect 115 0 2 0;
#X connect 116 0 2 0;
#X connect 117 0 2 0;
#X connect 118 0 2 0;
#X connect 119 0 2 0;
#X connect 120 0 2 0;
#X connect 121 0 2 0;
#X connect 122 0 2 0;