User Tools

Site Tools

한국어

logicpython:cubloc_api:eeread

EERead

Read data from non-volatile memory.

This feature is supported only on models with built-in FRAM.

Syntax

from cubloc import EERead
 
EERead(address: int,
    byteLength: int, 
    returnType: type[int] | type[float] | type[bytes] | type[bytearray] = int)

Parameters

  • address: EEPROM address (0 to 4095).
  • byteLength: Number of bytes to read. Must be positive and remain within the non-volatile memory's bounds.
  • returnType: Use int, float, bytes, or bytearray to control how the data is decoded. The default is int.

Return Value

Returns the data according to returnType as int, float, bytes, or bytearray.

Exceptions

  • TypeError: address, byteLength, or returnType is invalid.
  • ValueError: address or byteLength is out of range, the read would extend past address 4095, or a float read was requested with a byteLength other than 4.

Example

from cubloc import EERead
 
# Example usage
result = EERead(1, 1, int)
print(result)
logicpython/cubloc_api/eeread.txt · Last modified: by mfranklin