Components
keyboard_arrow_up
Add
Magnetic Sensor
-
Description
Magnetic Sensor
The Magnetic Sensor is a non visible component that measures the geomagnetic field environmental to the three axes of physical (x, y, z) in micro-Tesla (ยต T). We can know if the device has the sensor with the property 'Available'.
-
Events
- On Acurracy Changed
- Event that is executed when it is detected that the accuracy with which the sensor captures the magnetism changes. This event is useful if you want to only run certain actions with a high accuracy, for example. The accuracy usually depends on the quality of the sensor of the device.
- On Sensor Changed
- Event that runs when the sensor detects a change in the magnitude.
-
Properties
- Accuracy
- It allows to determine the accuracy with which our device captures the magnitude.
- Available (boolean)
- Allows you to determine if the device has the sensor size or not, if it is 'True' the device will have.
- X (decimal number)
- This property returns the X component of the magnetic field in micro Teslas.
- Y (decimal number)
- This property returns the Y component of the magnetic field in micro Teslas.
- Z (decimal number)
- This property returns the Z component of the magnetic field in micro Teslas.
-
Example
- Obtaining the magnitude
- When there is a change of magnitude, the sensor of the device detects it and triggers the event 'On Sensor Changed'. This event will provide us with the magnitude of each axis.