Pure Data

#N canvas 63 100 735 461 10;
#X text 322 -67 Dimmer This patch sends a binary number from 0 to 255
out the serial port to an Arduino conected to the port. It dims an
LED attached to the Arduino. Sept 27 \, 2010 by Scott Fitzgerald \,
based off the Dimmer Max/MSP example by David Mellis \, Tom Igoe and
myself;
#X text 16 42 change the slider to alter the brightness of the LED
;
#X obj 206 57 vsl 15 128 0 255 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 0 1;
#X floatatom 203 226 5 0 0 0 - - -;
#X obj 206 194 % 255;
#X obj 231 275 comport 1 9600;
#X obj 320 170 select 0 1;
#X obj 320 137 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X msg 370 219 open 1;
#X msg 320 217 close;
#X msg 513 222 ports;
#X obj 312 305 route ports;
#X obj 312 331 print port_list;
#X text 567 221 will print out available ports to message window;
#X text 341 136 toggle to start;
#X connect 2 0 4 0;
#X connect 3 0 5 0;
#X connect 4 0 3 0;
#X connect 5 1 11 0;
#X connect 6 0 9 0;
#X connect 6 1 8 0;
#X connect 7 0 6 0;
#X connect 8 0 5 0;
#X connect 9 0 5 0;
#X connect 10 0 5 0;
#X connect 11 0 12 0;