/ examples / ds3502_set_default.py
ds3502_set_default.py
 1  import board
 2  import adafruit_ds3502
 3  
 4  i2c = board.I2C()
 5  ds3502 = adafruit_ds3502.DS3502(i2c)
 6  
 7  
 8  #   Steps to test `set_default`:
 9  
10  #   1. Run the program once to see what the current default value is
11  #   2. Uncomment the call to `setWiperDefault` below and run it again.
12  #   3. Once the program has run with the `set_default` call,
13  #       comment out the line below again, then powercycle the DS3502
14  #       by removing then reattaching VCC
15  #   4. Then run the program again with the line commented out to see the
16  #       new default wiper value
17  
18  # ds3502.set_default(99)
19  
20  
21  print("Default wiper value: %d" % ds3502.wiper)