Skip to content

Commit 21cc390

Browse files
authored
Merge pull request #6 from FoamyGuy/update_docs_comments
update docstrings. comment writes in simpletest
2 parents f8fc83f + d98c1a9 commit 21cc390

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

adafruit_24lc32.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,21 @@ def __len__(self):
8484
"""The size of the current EEPROM chip. This is one more than the highest
8585
address location that can be read or written to.
8686
.. code-block:: python
87-
fram = adafruit_fram.FRAM_xxx() # xxx = 'I2C' or 'SPI'
87+
eeprom = adafruit_24lc32.EEPROM_I2C()
8888
# size returned by len()
89-
len(fram)
89+
len(eeprom)
9090
# can be used with range
91-
for i in range(0, len(fram))
91+
for i in range(0, len(eeprom))
9292
"""
9393
return self._max_size
9494

9595
def __getitem__(self, address):
9696
"""Read the value at the given index, or values in a slice.
9797
.. code-block:: python
9898
# read single index
99-
fram[0]
99+
eeprom[0]
100100
# read values 0 thru 9 with a slice
101-
fram[0:9]
101+
eeprom[0:9]
102102
"""
103103
if isinstance(address, int):
104104
if not 0 <= address < self._max_size:
@@ -134,12 +134,12 @@ def __setitem__(self, address, value):
134134
"""Write the value at the given starting index.
135135
.. code-block:: python
136136
# write single index
137-
fram[0] = 1
137+
eeprom[0] = 1
138138
# write values 0 thru 4 with a list
139-
fram[0:4] = [0,1,2,3]
139+
eeprom[0:4] = [0,1,2,3]
140140
"""
141141
if self.write_protected:
142-
raise RuntimeError("FRAM currently write protected.")
142+
raise RuntimeError("EEPROM currently write protected.")
143143

144144
if isinstance(address, int):
145145
if not isinstance(value, int):
@@ -230,7 +230,7 @@ def _write(self, start_address, data, wraparound=False):
230230
else:
231231
raise ValueError(
232232
"Starting address + data length extends beyond"
233-
" FRAM maximum address. Use ``write_wraparound`` to"
233+
" EEPROM maximum address. Use ``write_wraparound`` to"
234234
" override this warning."
235235
)
236236
with self._i2c as i2c:

examples/24lc32_simpletest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
# SPDX-License-Identifier: Unlicense
44

55
import board
6-
import adafruit_24lc32 as adafruit_eeprom
6+
import adafruit_24lc32
77

88
i2c = board.I2C()
9-
eeprom = adafruit_eeprom.EEPROM_I2C(i2c)
9+
eeprom = adafruit_24lc32.EEPROM_I2C(i2c)
1010

1111
print("length: {}".format(len(eeprom)))
1212

13-
eeprom[0] = 4
14-
print(eeprom[0])
13+
# eeprom[0] = 4
14+
# print(eeprom[0])
1515

16-
eeprom[0:4] = [9, 3, 8, 1]
17-
print(eeprom[0:4])
16+
# eeprom[0:4] = [9, 3, 8, 1]
17+
# print(eeprom[0:4])

0 commit comments

Comments
 (0)