User Tools

Site Tools

한국어

logicpython:cubloc_api:eewrite

EEWrite

Write data to non-volatile memory.

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

Syntax

from cubloc import EEWrite
 
EEWrite(address: int, data: int | float | bytes | bytearray, byteLength: int)

Parameters

  • address: EEPROM address (0 to 4095).
  • data: int, float, bytes, or bytearray value to write.
  • byteLength: Number of bytes to write. Must be positive and remain within the non-volatile memory's bounds. Float writes require 4. bytes and bytearray writes use the first byteLength bytes.

Exceptions

  • TypeError: address, data, or byteLength is invalid.
  • ValueError: address or byteLength is out of range, the write would extend past address 4095, a float write was requested with a byteLength other than 4, a float is not representable as a 32-bit value, or byteLength exceeds the source bytes length.

Example

from cubloc import EEWrite
 
# Example usage
EEWrite(1, 1, 1)
logicpython/cubloc_api/eewrite.txt · Last modified: by mfranklin