diff --git a/adafruit_fram.py b/adafruit_fram.py index 95e2e16..fa9461e 100755 --- a/adafruit_fram.py +++ b/adafruit_fram.py @@ -170,7 +170,7 @@ def __setitem__(self, address, value): if isinstance(address, int): if not isinstance(value, int): - raise ValueError("Data must be a single integer for single addresses") + raise ValueError("Data stored in an address must be an integer 0-255") if not 0 <= address < self._max_size: raise ValueError( "Address '{0}' out of range. It must be 0 <= address < {1}.".format( diff --git a/examples/fram_i2c_simpletest.py b/examples/fram_i2c_simpletest.py index 2bab14b..53851f7 100644 --- a/examples/fram_i2c_simpletest.py +++ b/examples/fram_i2c_simpletest.py @@ -36,6 +36,6 @@ ## a buffer the size of slice, which may cause ## problems on memory-constrained platforms. -# values = list(range(100)) # or bytearray or tuple -# fram[0] = values -# print(fram[0:99]) +# values = list(range(100)) # or bytearray or tuple +# fram[0:100] = values +# print(fram[0:100]) diff --git a/examples/fram_spi_simpletest.py b/examples/fram_spi_simpletest.py index 7af5c54..920efa3 100644 --- a/examples/fram_spi_simpletest.py +++ b/examples/fram_spi_simpletest.py @@ -27,6 +27,6 @@ ## a buffer the size of 'length', which may cause ## problems on memory-constrained platforms. -# values = list(range(100)) # or bytearray or tuple -# fram[0] = values -# print(fram[0:99]) +# values = list(range(100)) # or bytearray or tuple +# fram[0:100] = values +# print(fram[0:100])