MicroPython DS1841 Library¶
ds1841¶
MicroPython Driver for the DS1841 Potentiometer
Author(s): Bryan Siepert, Jose D. Montoya
-
class micropython_ds1841.ds1841.DS1841(i2c, address: int =
0x28)[source]¶ Driver for the DS1841 Sensor connected over I2C.
- Parameters:¶
- Raises:¶
RuntimeError – if the sensor is not found
Quickstart: Importing and using the device
Here is an example of using the
DS1841class. First you will need to import the libraries to use the sensorfrom machine import Pin, I2C from micropython_ds1841 import ds1841Once this is done you can define your
machine.I2Cobject and define your sensor objecti2c = I2C(1, sda=Pin(2), scl=Pin(3)) ds1841 = ds1841.DS1841(i2c)- property lut_mode_enabled : bool¶
Enables LUT mode. LUT mode takes sets the value of the Wiper based on the entry in a 72-entry Look Up Table. The LUT entry is selected using the
lut_selectionproperty to set an index from 0-71
- property lut_selection : int¶
Choose the entry in the Look Up Table to use to set the wiper. :param index: The index of the entry to use, from 0-71.