Monthly Archives: February 2007
Non-Mercury Tilt Switch
Non-mercury tilt switches are handy for reading when motion’s passed a threshold (and much cheaper than accelerometers), but sometimes hard to find. Here’s one Hatti Lim found.
Continue reading
Xbee Radio terminal program
Working with the Maxstream Xbee radios on OSX can be annoying because the screen program doesn’t print a linefeed automatically when it receives a carriage return…. Created 2 Feb. 2007 by Tom Igoe */ import processing.serial.*; Serial myPort; // the serial port you’re using void setup() { // list all the serial ports: println(Serial.list()); // based on the list of serial ports printed from the //previous command, change the 0 to your port’s number: String portnum = Serial.list()[0]; // initialize the serial port: myPort = new Serial(this, portnum, 9600); } void draw() { // not much happens on screen: background(0); } // This method responds to key presses when the // program window is active: void keyPressed() { switch (key) { // in OSX, if the user types return, // a linefeed is returned.
Continue reading