Loom_ZXGesture class

ZXGesture position / gesture sensor module.

Base classes

class LoomI2CSensor
Abstract root for I2C sensor modules.

Public types

enum Mode { POS, GEST }
Different modes of the ZX gesture sensor.

Protected variables

ZX_Sensor inst_ZX
Underlying ZX sensor manager instance.
Mode mode
Sensor mode (read positions or gesture - mutually exclusive)
uint8_t pos
Measured positions (x, y pos). Units: mm.
GestureType gesture
Last read gesture type.
String gesture_type
String labelling last read gesture type.
uint8_t gesture_speed
The speed of the last measured gesture.

CONSTRUCTORS / DESTRUCTOR

Loom_ZXGesture(LoomManager* manager, const byte i2c_address = 0x10, const uint8_t mux_port = 255, const Mode mode = Mode::POS)
Constructor.
Loom_ZXGesture(LoomManager* manager, JsonArrayConst p)
Constructor that takes Json Array, extracts args and delegates to regular constructor.
~Loom_ZXGesture() defaulted
Destructor.

OPERATION

void measure() override
Take any relevant measurements.
void package(JsonObject json) override
Package a modules measurements or state.

Enum documentation

enum Loom_ZXGesture::Mode

Different modes of the ZX gesture sensor.

Enumerators
POS

Measure z and x position.

GEST

Measure gestures.

Function documentation

Loom_ZXGesture::Loom_ZXGesture(LoomManager* manager, const byte i2c_address = 0x10, const uint8_t mux_port = 255, const Mode mode = Mode::POS)

Constructor.

Parameters
manager
i2c_address in Set(Int) | <0x10> | {0x10, 0x11} | I2C address
mux_port in Int | <255> | [0-16] | Port on multiplexer
mode in Set(ZXMode) | <0> | { 0("Position"), 1("Gesture") } | Gain level

Loom_ZXGesture::Loom_ZXGesture(LoomManager* manager, JsonArrayConst p)

Constructor that takes Json Array, extracts args and delegates to regular constructor.

Parameters
manager
in The array of constuctor args to expand

void Loom_ZXGesture::package(JsonObject json) override

Package a modules measurements or state.

Parameters
json out Object to put data into

void Loom_ZXGesture::print_measurements() const override

Print the last set of measurements taken.

Does not package the data.