Categories
Uncategorized

Reflect-O-Scope

The Reflect-O-Scope was an interactive museum exhibit I worked on a few years ago. It was a fantastical machine that allows users (typically children) to slide materials under a microscope and examine them. The materials were from the sponsor of the exhibit and consisted of specialty tape materials adhered to plastic boards.

One of the original ideas was to allow for focusing, but that got scrapped. We figured kids would put almost anything under a microscope, their hand, their little sister, etc. Focusing meant a moving mechanism, and it was deemed to complex at the time.

The sculptural build was done by John McGeen and Austin Boechler. My focus was on the hardware and software. There’s a USB microscope connected to a computer and then a small HDMI display in the “goggle” shaped piece that the user looks into. It’s all a bit “periscope” like in design.

The original design also had a secondary monitor (a large TV) that would be mounted further away, so people could see weird things on the TV and it would draw them over. Lots of features got killed due to lack of time or other reasons. Most of what you see on a museum floor probably started out a lot more complex when originally designed, and then simplified as time goes on.

I wrote the software, which is just an application written in Processing that automagically launches at boot up, runs full screen, and shows the output from the USB microscope. There’s also a companion application called “List Cameras” that can display all the connected USB cameras and all of the possible resolutions they support. This is there in case the USB microscope ever needs to get replace. The exhibit tech just needs to run the application and then edit a config file. No recompiling of the application is necessary.

One more fun addition was a white plastic tube running along the outside with some NeoPixels in it featuring some funky color runs to add to the fantastical nature of the piece.

One of the nice things about this component was that the software was created in-house, so the component could be replicated easily without additional license fees. (We had an amazing software partner we used for the complex things, but simple stuff was done, when possible, in-house by the tech team, which was basically me.)

Categories
Uncategorized

Shape Grid Circles

example-001

I love plotters and plotter art and if you’re into robots or other machines that draw, you should check out #PlotterTwitter and DrawingBots.net

example-002

While I’m still working on my new plotter (which is really an old HP7475A) I figured I’d have fun with Processing and write some code to generate some nice vector art. This is something I do every now and then. I’m someone who believes in writing code for pleasure. Some people are into that… I’m one of them.

example-003

I’ve also released this code in case someone else wants to generate some art for use with their own plotter or whatever device they have that can do something with it. (Like a laser cutter, for instance.) And yes, the sample images you see on the page were generated by the sketch. There are a few variables you can change to adjust things, like the spacing between circles, steps between circles inside of circles, and setting the limit on the smallest circle.

example-004

You can find the code on GitHub: Shape-Grid-Circles.

If you make something cool with this code, let me know! I’d love to see what you come up with.

Categories
Uncategorized

Rectangle Chaos

rects-01

I started playing around with the #plottertwitter thing and wanted to do some creative coding with Processing, and at least one person asked about the code, so I’ve included it below.

rects-02

Instead of drawing a rectangle, I’m creating a shape, and then varying the position of it a bit more with each row that is drawn. I reused some code I’ve used plenty of times before that keeps track of where things are drawn so the code knows when to start a new row, and when the screen is filled. After it draws a screen full it will save a PDF and exit.

Once you have a PDF (which is a vector file) you can make your plotter (or laser cutter, or CNC machine) do what you want with it. I typically bring the PDF into Inkscape and make any adjustments needed before I save it out in a format suitable for the machine I’ll be sending it to.

Find the code on GitHub: Rectangle-Chaos

If you make something cool with this code, let me know! I’d love to see what you come up with.

Categories
Uncategorized

In Advance of Troubleshooting

Teensy

I’m working on a new exhibit that will be using an Arduino (actually, a Teensy++ 2.0) to talk to an application running on a PC via serial data. The Teensy will be sending one byte to control the application’s behavior. This is an upgrade from an older version where the Teensy just sent keystrokes to the application. The nice thing about sending keystrokes is that it was very easy for anyone to troubleshoot because they could just open Notepad and press some buttons to see if they were sending any output. The bad part was that if a normally closed switch was open, it would just stream characters to the computer, which could make things hard to troubleshoot for some people.

ATMTester

To deal with the troubleshooting issue (which will eventually come up, as it always does) and make it easy for non-technical people to view a serial data stream, I wrote a simple application in Processing that reads the byte and displays the value, along with the status of each physical control of the exhibit.

ATMTester

The exhibit should always have the Teensy plugged into COM3 on the PC, but again, once something leaves the shop we never know what strange things might happen. When the application starts up it will present a dialog showing the COM ports, and asking you to select the correct one. If you select the wrong one it will just display nothing. This should be enough to help troubleshoot things via phone or email.

The trickiest part was the code to choose the COM port. (I know, we don’t call them “COM ports” on Mac OS X, and yes, the application works fine on Mac OS X, that’s another thing I love about Processing.) The code for choosing the COM port came from this forum thread How to let the user select COM (serial) port within a sketch?.

I did have to install Java to get the application to run, but it looks and functions like any other Windows application. Here’s hoping this all works and never has to be used, but is there just in case…

Categories
Uncategorized

Processing PhotoBooth v3

Simple Photobooth

It’s become a tradition around here to update my simple photo booth using Processing when a new version of Processing comes out. I’m not sure Processing 3.x is final yet, but I’m using it, and it’s got all sorts of good stuff. (You probably remember Processing PhotoBooth v2 and Processing PhotoBooth, which are both deprecated now, but see them to know what I’m talking about.)

One of the things new in Processing is the fullScreen() function, which gets rid of the whole “figure out the size of the display” issue, by just saying “run at full screen”!

There’s also a new thing called settings() which can appear before setup(), but I won’t get into that…

Here’s some code!

/**
 * PhotoBoothV3.pde
 */
 
import processing.video.*;
Capture cam;

void settings() {
  fullScreen();
}

void setup() {
  colorMode(RGB);
  String[] cameras = Capture.list();
  if (cameras.length == 0) {
    exit();
  } else {
    cam = new Capture(this, cameras[0]);
    cam.start();
  }   
  noSmooth();
  background(0);
}

void draw() {
  if (cam.available()) {
    cam.read();
    image(cam, 0, 0);
  }
} 

void keyPressed() {
    if (key == ' ') {  // space bar
       saveFrame("Picture-######.jpg");
    }
}

And hey, once again you’ve got a simplistic photo booth application. Congratulate yourself by purchasing this lovely button for it. (Or get this “bare” button and build your own damn case.)

Now, I don’t know if the fullScreen() thing has a bug, or if it’s my setup, but here’s what I’m seeing. I typically run my display at 1440×900 using QuickRes, which is a non-standard setup. When I ran the sketch it seemed to display at 1280×720 in the upper-left corner. My guess is that the camera is only capturing 1280×720, so the sketch only fills that amount of the display, no matter what the resolution is. I’ve tested it at higher resolutions and get the same thing. If I set the display to 1280×800 it’s all good.

This is most likely not a bug, but a “thing to be aware of” in the future…

Besides all that, the most exciting thing about Processing lately is that there is finally an official version that runs on the Raspberry Pi! This is super-awesome and has great potential for artists and others who do exhibits and installations. I’ve already got a few ideas in the works. ;)