API Reference

adafruit_as5600

CircuitPython driver for the AS5600 Magnetic Angle Sensor

  • Author(s): Liz Clark

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_as5600.AS5600(i2c: busio.I2C, address: int = _ADDR)

Driver for the AS5600 12-bit contactless position sensor.

Parameters:
  • i2c_bus (I2C) – The I2C bus the AS5600 is connected to.

  • address (int) – The I2C device address. Defaults to _ADDR

agc: int = 26

The current AGC (Automatic Gain Control) value. Range is 0-255 in 5V mode, 0-128 in 3.3V mode.

property angle: int

The scaled angle reading as a 12-bit value (0-4095). This is scaled according to ZPOS/MPOS/MANG settings.

property fast_filter_threshold: int

The fast filter threshold setting. Use FAST_FILTER_* constants.

property hysteresis: int

The hysteresis setting. Use HYSTERESIS_* constants.

property m_position: int

The maximum position (stop position) as a 12-bit value (0-4095).

magnet_detected: bool = 11

True if a magnet is detected, otherwise False

property magnitude: int

The magnitude value from the CORDIC processor (0-4095).

property max_angle: int

The maximum angle range as a 12-bit value (0-4095). This represents 0-360 degrees.

max_gain_overflow: bool = 11

True if AGC maximum gain overflow occurred (magnet too weak).

min_gain_overflow: bool = 11

True if AGC minimum gain overflow occurred (magnet too strong).

property output_stage: int

The output stage configuration. Use OUTPUT_STAGE_* constants.

property power_mode: int

The power mode setting. Use POWER_MODE_* constants.

property pwm_frequency: int

The PWM frequency setting. Use PWM_FREQ_* constants.

property raw_angle: int

The raw angle reading as a 12-bit value (0-4095). This is unscaled and unmodified by ZPOS/MPOS/MANG settings.

property slow_filter: int

The slow filter setting. Use SLOW_FILTER_* constants.

watchdog: bool = 7

Enable or disable the watchdog timer.

property z_position: int

The zero position (start position) as a 12-bit value (0-4095).

property zm_count: int

The number of times ZPOS and MPOS have been permanently burned (0-3). This is read-only.