From d24bac8cd16cc8d6aa345326960059c107b948e0 Mon Sep 17 00:00:00 2001 From: siddacious Date: Fri, 15 May 2020 17:11:22 -0700 Subject: [PATCH] fixing blinka example --- examples/ds1841_blinka_simpletest.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/examples/ds1841_blinka_simpletest.py b/examples/ds1841_blinka_simpletest.py index 23a99f5..4883d8f 100644 --- a/examples/ds1841_blinka_simpletest.py +++ b/examples/ds1841_blinka_simpletest.py @@ -1,10 +1,6 @@ -from time import sleep -import board -import busio -import adafruit_ds3502 - -i2c = busio.I2C(board.SCL, board.SDA) -ds3502 = adafruit_ds3502.DS3502(i2c) +####### NOTE ################ +# This example is meant for use with Blinka/rasberry Pi due to the lack of analog pins. +# CircuitPython board users should run the "ds1841_simpletest.py" example # WIRING: # 1 Wire connecting VCC to RH to make a voltage divider using the @@ -12,15 +8,23 @@ ds3502 = adafruit_ds3502.DS3502(i2c) # As this code runs, measure the voltage between ground and the RW (wiper) pin # with a multimeter. You should see the voltage change with each print statement. +from time import sleep +import board +import busio +import adafruit_ds1841 + +i2c = busio.I2C(board.SCL, board.SDA) +ds1841 = adafruit_ds1841.DS1841(i2c) + while True: - ds3502.wiper = 127 + ds1841.wiper = 127 print("Wiper value set to 127") sleep(5.0) - ds3502.wiper = 0 + ds1841.wiper = 0 print("Wiper value set to 0") sleep(5.0) - ds3502.wiper = 63 + ds1841.wiper = 63 print("Wiper value set to 63") sleep(5.0)