ds1841_blinka_simpletest.py
1 ####### NOTE ################ 2 # This example is meant for use with Blinka/rasberry Pi due to the lack of analog pins. 3 # CircuitPython board users should run the "ds1841_simpletest.py" example 4 5 # WIRING: 6 # 1 Wire connecting VCC to RH to make a voltage divider using the 7 # internal resistor between RH and RW 8 9 # As this code runs, measure the voltage between ground and the RW (wiper) pin 10 # with a multimeter. You should see the voltage change with each print statement. 11 from time import sleep 12 import board 13 import busio 14 import adafruit_ds1841 15 16 i2c = busio.I2C(board.SCL, board.SDA) 17 ds1841 = adafruit_ds1841.DS1841(i2c) 18 19 while True: 20 ds1841.wiper = 127 21 print("Wiper value set to 127") 22 sleep(5.0) 23 24 ds1841.wiper = 0 25 print("Wiper value set to 0") 26 sleep(5.0) 27 28 ds1841.wiper = 63 29 print("Wiper value set to 63") 30 sleep(5.0)