March 2008

International Keyboard Mapping Fun

I’ve had requests from folks outside the US asking how to get the arcane keyboard commands needed for the screen program in OSX. For those who’ve used screen commands, you know that to get out of a screen session, you hit control-A followed by control-\ and then respond Y when it asks if you want to close all screen windows. On the Norwegian keyboard mapping of OSX, we could find no way to get control-\. So we found a workaround. Change the keyboard layout to the US keyboard, like so:

Continue Reading »

OSX

Permalink

Sending Mail from Processing

Here’s a piece of code to send mail from Processing. It uses the net library. Warning: your mail server may not use port 25.

/* mail_client
 by Tom Igoe

  A simple mail sender client
 Created 21 January 2006
 */

import processing.net.*;
Client myClient;
int clicks;
String reply = null;
boolean sent = false;
void setup() {
  // Connect:
  myClient = new Client(this, "echonyc.com", 25);
  delay(300);

} 

void draw() {
  if(!sent) {
    waitForReply();
    myClient.write("HELO echonyc.com\n");
    waitForReply();
    myClient.write("MAIL FROM:tigoe@echonyc.com\n");
    waitForReply();
    myClient.write("RCPT TO:tigoe@echonyc.com\n");
    waitForReply();
    myClient.write("DATA\n");
    waitForReply();
    myClient.write("Subject:Noodles\n");
    myClient.write("From:tigoe@echonyc.com\n");
    myClient.write("To:tigoe@tigoe.net\n");
    myClient.write("\rHere's the body\n.\n");
    waitForReply();
    myClient.write("QUIT\n\r");
    waitForReply();
  }
  sent = true;
} 

void waitForReply() {
  int newChar = 0;
  while (newChar != 10) {
    if(myClient.available() > 0) {
      newChar = myClient.read();
      reply += (char)newChar;
    }
  }
  println(reply);
}

Processing

Permalink

RFID Reader and Image Display

This program reads ID Innovations ID-12 RFID readers and matches the tags against a list of known tags. It’s an illustration of how to use an RFID reader to associate data with a set of tags.

/*
  RFID Reader and image display
  Language: Processing

  This program reads ID Innovations ID-12 RFID readers rom two serial ports.
  It matches the tags against a list of known tags, and uses the match to
  associate a name with the tag.  It also scans the sketch's data directory
  to load an image associated with the name.

  Created 12 Mar 2008
  by Tom Igoe and the interaction design class at AHO, Spring 2008
  directory reading and image scanning based on an example from Marius Watts

*/

Continue Reading »

Processing

Permalink

Reading Multiple Serial Ports in Processing

This program reads multiple serial ports and lets you know when data comes from one port or the other. The two ports in this example are attached to ID Innovations ID-12 RFID readers. The ID-12 readers send a string that ends with a byte whose value is 0×03.

/*
   Multiple Serial Ports
   Language: Processing

   This program reads multiple serial ports and lets you know when data comes
   from one port or the other. The two ports in this example are attached to
   ID Innovations ID-12 RFID readers. The ID-12 readers send a string that ends
   with a byte whose value is 0x03.

   Created 12 Mar 2008
   by Tom Igoe
*/

Continue Reading »


Processing

Permalink

Control Geek

Control Geek - John Huntington’s guide to all things in show control. John’s book on show control covers every show control data protocol you might need and then some.

circuits

Permalink