The compass uses the device’s magnetometer to give a heading reading between 0 – 360. Note that this value is only accurate when the device is relatively flat. There is no control over update rate; updates are received whenever the device perceives a change in orientation.
Additional JSON Attributes
- onvaluechange – this event handler is called after the magnetometer has been read but before its value it outputted.
Simple JSON
{ "name":"comp", "type":"Compass", "protocol":"local", "min":0, "max":1, },
Extra JSON
{ "name":"comp", "type":"Compass", "onchange":"compLabel.changeValue(this.value);", "protocol":"local", "min":0, "max":1 },