Magnetometer
Magnetometer
A magnetometer is a device that measures magnetic field or magnetic dipole moment.
To get started using it, you must use KmpMagnometer. To subscribe to changes to the device's magnetometer data, we invoke the startListening function. We can then process the results in our app.
_5KmpMagnometer.startListening { _5 val x = it.first_5 val y = it.second_5 val z = it.third_5}
To stop listening to acc changes, we use the function stopListening. It's important to deactivate the listener, so the component doesn't continue to broadcast magnetometer data changes to our app.
_1KmpMagnometer.stoplistening()
Any Setup Required?
None