This is the documentation for the latest development branch of MicroPython and may refer to features that are not available in released versions.

If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

zephyr.zsensor – Zephyr sensor bindings.

Zephyr sensor bindings.

The zsensor module contains a class for using sensors with Zephyr.

Attributes

ACCEL_X

Acceleration on the X axis, in m/s^2.

ACCEL_Y

Acceleration on the Y axis, in m/s^2.

ACCEL_Z

Acceleration on the Z axis, in m/s^2.

ALTITUDE

Altitude, in meters.

DIE_TEMP

Device die temperature in degrees Celsius.

GYRO_X

Angular velocity around the X axis, in radians/s.

GYRO_Y

Angular velocity around the Y axis, in radians/s.

GYRO_Z

Angular velocity around the Z axis, in radians/s.

HUMIDITY

Humidity, in percent.

LIGHT

Illuminance in visible spectrum, in lux.

MAGN_X

Magnetic field on the X axis, in Gauss.

MAGN_Y

Magnetic field on the Y axis, in Gauss.

MAGN_Z

Magnetic field on the Z axis, in Gauss.

PRESS

Pressure in kilopascal.

PROX

Proximity. Dimensionless. A value of 1 indicates that an object is close.

Classes

Sensor

Device names are defined in the devicetree for your board.

Module Contents

class zephyr.zsensor.Sensor(device_name)

Device names are defined in the devicetree for your board. For example, the device name for the accelerometer in the FRDM-k64f board is “FXOS8700”.

get_float(sensor_channel) float

Returns the value of the sensor measurement sample as a float.

get_int(sensor_channel) int

Returns only the integer value of the measurement sample. (Ex. value of (1, 500000) returns as 1)

get_micros(sensor_channel) Incomplete

Returns the value of the sensor measurement sample in millionths. (Ex. value of (1, 500000) returns as 1500000)

get_millis(sensor_channel) Incomplete

Returns the value of sensor measurement sample in thousandths. (Ex. value of (1, 500000) returns as 1500)

measure() Incomplete

Obtains a measurement sample from the sensor device using Zephyr sensor_sample_fetch and stores it in an internal driver buffer as a useful value, a pair of (integer part of value, fractional part of value in 1-millionths). Returns none if successful or OSError value if failure.

zephyr.zsensor.ACCEL_X: Incomplete

Acceleration on the X axis, in m/s^2.

zephyr.zsensor.ACCEL_Y: Incomplete

Acceleration on the Y axis, in m/s^2.

zephyr.zsensor.ACCEL_Z: Incomplete

Acceleration on the Z axis, in m/s^2.

zephyr.zsensor.ALTITUDE: Incomplete

Altitude, in meters.

zephyr.zsensor.DIE_TEMP: Incomplete

Device die temperature in degrees Celsius.

zephyr.zsensor.GYRO_X: Incomplete

Angular velocity around the X axis, in radians/s.

zephyr.zsensor.GYRO_Y: Incomplete

Angular velocity around the Y axis, in radians/s.

zephyr.zsensor.GYRO_Z: Incomplete

Angular velocity around the Z axis, in radians/s.

zephyr.zsensor.HUMIDITY: Incomplete

Humidity, in percent.

zephyr.zsensor.LIGHT: Incomplete

Illuminance in visible spectrum, in lux.

zephyr.zsensor.MAGN_X: Incomplete

Magnetic field on the X axis, in Gauss.

zephyr.zsensor.MAGN_Y: Incomplete

Magnetic field on the Y axis, in Gauss.

zephyr.zsensor.MAGN_Z: Incomplete

Magnetic field on the Z axis, in Gauss.

zephyr.zsensor.PRESS: Incomplete

Pressure in kilopascal.

zephyr.zsensor.PROX: Incomplete

Proximity. Dimensionless. A value of 1 indicates that an object is close.