Documentation
¶
Overview ¶
Package magnetometer reads the magnetic field around the phone: for a metal detector, say, or a compass of your own.
nimbus native plugin add magnetometer
go magnetometer.Watch(ctx, 10, func(r magnetometer.Reading) { setField(r.Strength()) })
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Reading ¶
type Reading struct {
X float64 `json:"x"` // across the screen, positive to the right
Y float64 `json:"y"` // up the screen, positive to the top
Z float64 `json:"z"` // out of the screen, positive toward you
}
Reading is the field on each axis, in microteslas, as the phone is held upright.
Click to show internal directories.
Click to hide internal directories.