Skip to content

Commit 837c4d6

Browse files
committed
fixed default example
1 parent bfc988a commit 837c4d6

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

examples/ds3502_set_default.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
from time import sleep
22
import board
33
import adafruit_ds3502
4-
from analogio import AnalogIn
54

65
i2c = board.I2C()
76
ds3502 = adafruit_ds3502.DS3502(i2c)
8-
wiper_output = AnalogIn(board.A0)
97

10-
ds3502.wiper = 127
11-
print("Wiper value: %d"%wiper_output.value)
12-
sleep(1.0)
138

14-
ds3502.wiper = 0
15-
print("Wiper value: %d"%wiper_output.value)
9+
# Steps to test `set_default`:
10+
11+
# 1. Run the program once to see what the current default value is
12+
# 2. Uncomment the call to `setWiperDefault` below and run it again.
13+
# 3. Once the program has run with the `set_default` call,
14+
# comment out the line below again, then powercycle the DS3502
15+
# by removing then reattaching VCC
16+
# 4. Then run the program again with the line commented out to see the
17+
# new default wiper value
18+
19+
# ds3502.set_default(99)
20+
21+
22+
print("Default wiper value: %d"%ds3502.wiper)

0 commit comments

Comments
 (0)