Skip to content

Commit b01342f

Browse files
Create example.py
1 parent 5e7ab37 commit b01342f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

example.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from ad5292 import AD5292
2+
# Example usage:
3+
pot = AD5292(1, 5) # SPI bus 1, CS pin 5
4+
pot.set_wiper_position(512) # Set wiper position to mid-range
5+
control_reg_value = pot.read_control_register()
6+
print("Control Register:", control_reg_value)
7+
pot.write_control_register(3) # Write a new value to the control register
8+
pot.close()

0 commit comments

Comments
 (0)