Computer Code

Arduino + XBee AppleRemote prank

XBee icon

It's common knowledge that MacBooks and iMacs can be controlled with any Apple remote. This feature is turned on by default, so unless people manually disable remotes, or pair a specific remote to their computer, they are easy victims for a simple prank. You can control the volume, start/pause songs in iTunes, advance and go back a song in the library, and, most annoyingly, enter FrontRow by pressing the appropriate button on the remote. Of course, it would be nice not to actually have to approach the "prankee" with a conspicuous Apple remote. It would be far nicer to have a microcontroller mimic the IR codes and control everything remotely…

Matlab animations tutorial

Matlab icon

Below is a PDF of my presentation and the code for a tutorial on making elaborate multi-axes movies with Matlab. The tutorial was part of the "hallway salon" series that has become a tradition in the Daniel Lab.

The code contained on this page contains a framework for saving movies from MATLAB that should be easily adaptable for your own work. I tried to add as many comments in the code, so it should be fairly self-explanatory.

Java / Processing / OpenCV: camera trigger

Processing icon

For many applications in behavioral biology, it's nice to trigger events or devices (e.g. cameras, lights) when an animal moves into a specific region of a camera view. In order to trigger our lab's high-speed video cameras, I wrote a simple program in the Java language that uses an inexpensive web-cam to detect if objects move from one frame to the next. A region of interest can be set by clicking and dragging to position a red rectangle on the camera view. Thresholds can be changed to make the trigger more or less sensitive, and it can be toggled between an "armed" and "unarmed" mode.

Processing: 2D Waviness

Processing icon

Beyond sine waves: Perlin noise, images, and, yes, (pixel-based) sinusoids

My second attempt at creating a moving sine wave is somewhat different than in the first example. This time, I created a sine wave class, which during initialization creates an array holding the pixel values of a sine wave. I also added a Perlin noise class, for making a 2D noise pattern, as well as an image class to load an images.

Pages