http://mbed.org/users/tobyspark/code/OSC/#fdea65150534