Accelerometer

The Accelerometer widgets reads values from the 3-axis accelerometer in iOS devices. There can only be one Accelerometer widget per interface. The default min and max values are -2.307 to 2.307; this represents the range of g-force values the device is capable of reading. As per all widgets, if a MIDI destination is selected the default range will be 0 – 127.

Additional JSON Attributes

  • updateRate : determines how often the accelerometer will be read.

Scripting
Properties

  • x – the last read value from the x-axis of the accelerometer
  • y – the last read value from the y-axis of the accelerometer
  • z – the last read value from the z-axis of the accelerometer

Methods

  • setUpdateRate(rateInHz) – this method changes the rate of updates sent by the accelerometer
  • onvaluechange – the only event handler for the accelerometer, this event is called after they accelerometer has been read but before its values have been outputted, allowing you to manipulate the values before they are sent to a destination

Simple JSON

{
    "name": "acc",
    "type": "Accelerometer",
    "min": 0,
    "max": 1,
},

Extra JSON

{
    "name": "acc",
    "type": "Accelerometer",
    "updateRate":50,
    "min": 0,
    "max": 1,
    "onvaluechange": "accValueLabelX.setValue(this.x); accValueLabelY.setValue(this.y);",
},
This work is licensed under GPL - 2009 | Powered by Wordpress using a heavily modified version of the theme aav1