This was a project for a class at Parsons. I designed and programmed a “voodoo doll” that responds to serial data input to Arduino. The user can control potentiometers that correspond to the doll’s different body parts. The data generated by the potentiometers affected the movement of a corresponding Processing sketch of the doll that appeared on screen.

How the code works:

Each part of the voodoo doll (on screen) is a separate image file. I used traditional x/y coordinates to lay them out initially, and then used pushMatrix and popMatrix to rotate the images according to the serial input from the potentiometers.

The rotation function divides PI by the number that comes in through the Arduino. This number is mapped to a very small range, so that the movement responds more naturally to the turning of the knobs.