Skip to content

Commit 4573668

Browse files
authored
Merge pull request #32 from tekktrik/fix/update-value-error
Update ValueError text, example files
2 parents 41b0df1 + 23c8e36 commit 4573668

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

adafruit_fram.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def __setitem__(self, address, value):
170170

171171
if isinstance(address, int):
172172
if not isinstance(value, int):
173-
raise ValueError("Data must be a single integer for single addresses")
173+
raise ValueError("Data stored in an address must be an integer 0-255")
174174
if not 0 <= address < self._max_size:
175175
raise ValueError(
176176
"Address '{0}' out of range. It must be 0 <= address < {1}.".format(

examples/fram_i2c_simpletest.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@
3636
## a buffer the size of slice, which may cause
3737
## problems on memory-constrained platforms.
3838

39-
# values = list(range(100)) # or bytearray or tuple
40-
# fram[0] = values
41-
# print(fram[0:99])
39+
# values = list(range(100)) # or bytearray or tuple
40+
# fram[0:100] = values
41+
# print(fram[0:100])

examples/fram_spi_simpletest.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@
2727
## a buffer the size of 'length', which may cause
2828
## problems on memory-constrained platforms.
2929

30-
# values = list(range(100)) # or bytearray or tuple
31-
# fram[0] = values
32-
# print(fram[0:99])
30+
# values = list(range(100)) # or bytearray or tuple
31+
# fram[0:100] = values
32+
# print(fram[0:100])

0 commit comments

Comments
 (0)