• Just a little project I did to get familiar with the Puck, but maybe it's interesting to someone nonetheless. A self-calibrating volume control knob using the magnetometer and bluetooth hid.

    To use it, upload the script, lay the Puck flat on the table, spin it slowly one or two times to calibrate the magnetometer readings. Then press the Puck once and spin it to control the volume of the devices it is connected to via bluetooth (if it is supported). There are some problems with detecting overflow, but it works ok.

    Beware, this is polling the magnetometer with 10 Hz, so it might drain the battery if you keep it running.


Avatar for cryptobias @cryptobias started