We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39c33a9 commit b46e79dCopy full SHA for b46e79d
examples/seesaw_eeprom_test.py
@@ -9,18 +9,17 @@
9
import board
10
from adafruit_seesaw import seesaw
11
12
-ss = seesaw.Seesaw(board.I2C())
13
-
14
-write_value = 42
+i2c_bus = board.I2C()
+ss = seesaw.Seesaw(i2c_bus)
15
16
value = ss.eeprom_read8(0x02) # Read from address 2
17
print("Read 0x%02x from EEPROM address 0x02" % value)
18
19
-ss.eeprom_write8(0x02, write_value) # Write value to address 2
20
-print("Writing value")
+print("Incrementing value")
+ss.eeprom_write8(0x02, (value + 1) % 0xFF)
21
22
23
-print("Read 0x%02x from EEPROM address 0x02" % value)
+print("Second read 0x%02x from EEPROM address 0x02" % value)
24
25
while True:
26
# Do not write EEPROM in a loop, it has 100k cycle life
0 commit comments