User Tools

Site Tools

한국어

logicpython:cubloc_api:eeread

This is an old revision of the document!


EERead

Read data from non-volatile memory

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 EEPROM bounds.
  • returnType: Use int, float, bytes, or bytearray to control how the EEPROM bytes are decoded. The default is int.

Return Value

Returns the EEPROM data decoded 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.1776045761.txt.gz · Last modified: by mfranklin