Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Kinect Wings
Kinect Wings is a gesture controller for Tiny Wings. Check out this video:
We used Synapse to get the coordinates of hands. Synapse is an open source program which tracks human gestures with kinect and sends the position of joints or bones through OSC messages. We then need another program to receive, and handle these messages. For that task we used Processing with OSCP5. This sketch will convert the hand position to a servo direction, and sending that data over serial port. An Arduino will then receive the data on serial port and send the values to the servo motor connected directly to the Arduino board.
You will need:
- Kinect
- Arduino
- a Servo 5VDC
- iPhone 4S (only 4S version is enabled to be connected to a projector)
- any kind of stylus for iPad/iPhone (can be also DIY like here:
- a Mac with OSX
- vga–dock connector cable
- a projector
- cardboard, gluegun, duct tape, wires
- Processing (
- oscP5 library for Processing - Follow the instructions to put the unzipped files to the right folder
- Arduino software (
- Synapse for Kinect (
- Tiny Wings for iPhone (
1. Get a little 5V servo motor from a hobby electronic shop, for example this one:
2. Create a little square layout pillar from cardboard with about 20 cm height which will hold the servo motor.
3. Attach servo on the cardboard with gluegun to the cardboard.
4. Attach stylus to the arm of the servo using some duct tape
5. Place iPhone under the stylus, connect iPhone to a projector and a music stand
6. Start Tiny Wings on iPhone
7. Connect Arduino to the computer via USB and connect the servo to the Arduino board. You can find instructions here:
8. Upload the supplied code to the Arduino board
9. Connect the Kinect to another USB port on your computer
10. Run Synapse for Kinect.
11. Start Processing, and run the supplied Processing code.
12. Make a psi pose in front of the kinect. You can check the control window of Synapse when your body is recognized.
13. Have fun!
import processing.serial.*;
import oscP5.*;
import netP5.*;
OscP5 oscP5;
NetAddress myRemoteLocation;
Serial myPort;
float rightHand;
void setup() {
myPort = new Serial(this, Serial.list()[0], 9600);
oscP5 = new OscP5(this,12345);
myRemoteLocation = new NetAddress("",12346);
void draw() {
int val = 40+int(rightHand/6);
if (val<0) {val =0; }
myPort.write(val); // sending value to servo
// send keepalive messages to Synapse
OscMessage myMessage = new OscMessage("/righthand_trackjointpos");
oscP5.send(myMessage, myRemoteLocation);
void oscEvent(OscMessage theOscMessage) {
String addrPattern = theOscMessage.addrPattern();
if (addrPattern.equals("/righthand_pos_screen")) {
rightHand = theOscMessage.get(1).floatValue();
} else {
rightHand = 0; // park the stylus in safe position
#include <Servo.h>
Servo myservo;
int serialGet;
void setup()
void loop()
if (Serial.available()>0) {
// getting value from Processing on serial
serialGet =;
// writing to servo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment