i2cencoderv21
¶
A CircuitPython library for the I2CEncoder v2.1 board from Simon Caron.
- Author(s): Ben Shockley & Simon Caron
Implementation Notes¶
Hardware: Software and Dependencies: * Adafruit CircuitPython firmware for the supported boards:
- Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
-
class
i2cencoderlibv21.
I2CEncoderLibV21
(i2c_bus, address)¶ - Helper library for the i2c Encoder from Simon Caron
- http://www.duppa.net/i2c-encoder-v2-1/
Parameters: - i2c_bus (I2C) – The I2C bus the encoder is connected to.
- address (byte) – The I2C slave address of the encoder
- config (byte) – Initial setup config. Default is CONFIG_DEFAULT
-
autoconfig_interrupt
()¶ Automatically configures the interrupt register according to the callback(s) declared.
-
begin
(config=32)¶ Set the encoder’s general configuration.
Parameters: or 2-byte config (1) – Configuration to be set.
-
read_eeprom
(add)¶ Read the data in the EEPROM
Parameters: add (byte) – registry address from which to read.
-
reset
()¶ Reset the encoder.
-
setInterrupts
(interrupts)¶ Set the Interrupt Configuration Manually.
Parameters: interrupts (byte) – byte contining interrupt configuration.
-
update_status
()¶ Runs the callback for the encoder status.
-
write_eeprom
(add, data)¶ write the data to the EEPROM
Parameters: - add (byte) – registry address where to write.
- data (byte) – 1-Byte of data to write.