File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 1
1
from time import sleep
2
2
import board
3
3
import adafruit_ds3502
4
- from analogio import AnalogIn
5
4
6
5
i2c = board .I2C ()
7
6
ds3502 = adafruit_ds3502 .DS3502 (i2c )
8
- wiper_output = AnalogIn (board .A0 )
9
7
10
- ds3502 .wiper = 127
11
- print ("Wiper value: %d" % wiper_output .value )
12
- sleep (1.0 )
13
8
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 )
You can’t perform that action at this time.
0 commit comments