Monthly Archives: October 2007
XBee to USB modules
The USB board is nice, because in addition to having a built-in 5V-to-3.3V regulator and indicator LEDs, it’s got all the pins of the XBee broken out on the side of the board…. As the US dollar continues to sink, they’re a bit pricier for US customers, but still reasonable, for now.Thanks to Rob Faludi and Jeff LeBlanc for testing help, and to Luigi Carnevale for supplying sample boards.
Continue reading
Startup Checks
Since this value is stored even when the Arduino is not powered, you’re going to get a new number each time it’s run.Thanks to Hans for the code./* EEPROM reset checker By Hans Steiner Reads a value from the EEPROM on startup, prints it out, and increments the value then stores it back in EEPROM…. Created 25 Oct. 2007*/ #include <EEPROM.h>int potPin = 5; // select the input pin for the potentiometerint motorPin = 9; // select the pin for the LEDint value = 0; // variable to store the value coming from the sensorint resetCountByte = 36;void setup() { // open the serial port Serial.begin(9600); // read the last value stored in the EEPROM: value = EEPROM.read(resetCountByte); // send it out the serial port: Serial.println(value); // increment it and write it back to the EEOPROM: EEPROM.write(resetCountByte, value + 1); pinMode(motorPin, OUTPUT); // declare the motor as an OUTPUT pinMode(13, OUTPUT); // declare the LED pin as an output digitalWrite(13,HIGH); // turn on the LED}void loop() { // you can do anything you want to here.}
Continue reading
Peak finding in Processing
This example shows how to do it in PRocessing, assuming the microcontroller is ju/* Peak Finding graphing sketch by Tom Igoe with help from Matt Young This program takes raw bytes from the serial port at 9600 baud and graphs them…. Created 20 April 2005 Updated 23 Oct 2007 */import processing.serial.*;Serial myPort; // The serial port// initial variables:int hPosition = 1; // the horizontal position on the graphint threshold = 10; // minimum threshold for peak findingint peakValue = 0; // the current peak valuevoid setup () { size(400, 300); // window size // List all the available serial ports println(Serial.list()); // Open whatever port is the one you’re using.
Continue reading
RFID Readers from SonMicro
Mike Kuniavsky and Tod Kurt of ThingM recommended these RFID readers from Son Micro. They’re some of the cheapest ones I;ve seen on the market, and relatively small.
Continue reading
Data graphing program that saves to a file
This Processing sketch takes data from the serial port, graphs it, and writes it to a text file with a time stamp if there’s a significant change in any of the incoming values…. Created 20 April 2005 Updated 15 October 2007 */import processing.serial.*;Serial myPort; // The serial portint arrayLength = 5; // number of values to expectint[] sensorValues = new int[arrayLength]; // array to hold the incoming valuesint hPosition = 0; // horizontal position on the graphint displayChannel = 0; // which of the five readings is being displayedString dataSet; // string holding the incoming data int threshold = 50; // threshold for whether or not to write // data to a filevoid setup () { size(400, 300); // window size // List all the available serial ports println(Serial.list()); // I know that the third port in the serial list on my mac // is always my Keyspan adaptor, so I open Serial.list()[2]. Continue reading
USBTinyISP
Recently, I’d been trying to re-program some Atmega168′s for use in Arduino modules, and was having no luck using my AVRISP MkII programmer…. Even more fortunately, Limor Fried has written some nice instructions on the programmer and on installing and running avrdude to program with it.
Continue reading
Virtual Color Fader for Max/MSP
This Max/MSP patch reads in a serial string like this:RnnnGnnnBnnnmax v2;#N vpatcher 0 44 587 638;#P window setfont “Sans Serif” 9.;#P comment 137 34 100 196617 Read the serial port every two milliseconds;#P window linecount 1;#P newex 156 276 27 196617 / 4;#P number 156 254 35 9 0 1023 3 3 0 0 0 221 221 221 222 222 222 0 0 0;#P newex 106 276 27 196617 / 4;#P number 106 254 35 9 0 1023 3 3 0 0 0 221 221 221 222 222 222 0 0 0;#P newex 55 276 27 196617 / 4;#P number 55 254 35 9 0 1023 3 3 0 0 0 221 221 221 222 222 222 0 0 0;#P hidden newex 55 303 112 196617 bgcolor 220 120 192;#P user multiSlider 167 145 125 91 0…. 1 3449 15 0 0 2 0 0 0;#M frgb 0 0 0;#M brgb 255 255 255;#M rgb2 127 127 127;#M rgb3 0 0 0;#M rgb4 37 52 91;#M rgb5 74 105 182;#M rgb6 112 158 18;#M rgb7 149 211 110;#M rgb8 187 9 201;#M rgb9 224 62 37;#M rgb10 7 114 128;#P user multiSlider 438 145 125 91 0.
Continue reading
Analog to Frequency for Max/MSP
This Max/MSP patch takes a serial string in and converts it to a numeric value, then plays a frequency using the value.To use the patch, copy the text and paste it into a new max patch window.Thanks to David Mellis and Jamie Allen for the collaboration.max v2;#N vpatcher 193 214 742 698;#P user multiSlider 299 322 125 91 0…. 1 3449 15 0 0 2 0 0 0;#M frgb 0 0 0;#M brgb 255 255 255;#M rgb2 127 127 127;#M rgb3 0 0 0;#M rgb4 37 52 91;#M rgb5 74 105 182;#M rgb6 112 158 18;#M rgb7 149 211 110;#M rgb8 187 9 201;#M rgb9 224 62 37;#M rgb10 7 114 128;#P window setfont “Sans Serif” 9.;#P comment 278 81 191 196617 Click here to get a list of serial ports;#P comment 144 236 112 196617 Here’s your frequency;#P comment 331 214 215 196617 Convert ASCII to symbol;#P comment 331 191 215 196617 Convert integer to ASCII;#P number 263 235 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;#P newex 263 214 62 196617 fromsymbol;#B color 5;#P newex 263 191 40 196617 itoa;#B color 5;#P newex 263 168 55 196617 zl group 4;#P newex 207 130 67 196617 select 10 13;#P toggle 207 37 15 0;#P newex 207 59 52 196617 metro 10;#P message 242 81 32 196617 print;#P newex 207 106 71 196617 serial a 9600;#P window linecount 2;#P comment 12 59 191 196617 Read serial input buffer every 10 milliseconds;#P window linecount 3;#P comment 280 130 215 196617 If you get newline (ASCII 10) \, send the list.
Continue reading
Physical Pixel Controller
This Max/MSP patch turns on or off an LED attached to an Arduino.
Continue reading
LED Fader in Max/MSP
This Max/MSP patch sends data out the serial port.
Continue reading