W2O

- WiTilt to OSC

Instructions (w/ Screenshots)

Step 0

Before using WiTilt v.2, make sure you have set up the device properly. Instructions can be found here. A screenshot of my settings is below:
Important! To get the most correct measurements possible, it is highly recommended that you
  1. calibrate the sensor a) when you first use it and/or b) make major changes with its configuration, and
  2. make a note of calibration maxima and minima for x, y, and z axes. These values must be entered into W2O in the next step.
Note: For command-line setup of WiTilt over serial connection, I use minicom: a pre-compiled binary for OS 10.4 can be found here. Alternatively, you can use screen command, which comes with OS X by default. In either case, here's the setup values I used for connection:
Baud rate: 57600
Parity: No
Data bits: 8
Stop bits: 1

Step 1

Run W2O.
From the menu, choose W2O-Preferences. This will open a panel in which you need to enter the six calibration values you obtained in step 0.
When finished, close the panel.
In W2O, click Open to find WiTilt sensor. This will lead to the next step.

Step 2


Choose BlueRadios in the Select Bluetooth Device panel. If successfully found, it will go over to step 3.

Step 3


Now back to W2O, we can see Bluetooth device name and its MAC address.
OSC target settings (IP and Port) can be modified only before starting UDP transmission by clicking Start.
Status and OSC addresses of data fields (Raw Data, Angle (Deg.), and Accel. (Mag.), on the other hand, can be changed anytime during transmission.

Contents of data fields are summarized below:
Raw Data: measurement data from a 10-bit ADC (0-1023).
Angle (Deg.): tilt angle in degrees (-90 ~ 90).
Accel (Mag.): (magnitude of acceleration) / g in percent (0~100).
For details on Freescale MMA7260Q, please check this document. More information on how to use it can be found here.
Note: make sure the LED goes OFF before beginning transmission by pressing the reset button (usually twice, sometimes once).

To end OSC transmission, click Stop: you can then restart it, or Close the Bluetooth connection.

Use Examples

Max/MSP

Pd

< W2O Main
woony.home

Downloads

W2O.zip
Source (Xcode project).
W2O.app.zip
Executable binary.
WiTilt.pat
Max/MSP patch to show how to take WiTilt data via OSC.
WiTilt.pd
Pd patch to show how to take WiTilt data via OSC.

Links

Sparkfun: WiTilt
Bluetooth.com
OSC
Freescale MMA7260Q:
  - Tech. data
  - App. note