beginRAM()

[RAM]
void beginRAM (unsigned short size, unsigned char byte_width = 1);

Description

Initializes the RAM memory, allowing the programmer to read and write data to the RAM.

Parameters

size: the size of the RAM memory.

byte_width: the width of the data to be written in bytes.

Returns

Nothing.

Example Code

The code initializes the RAM memory with a size of 1024 bytes and a data width of 1 byte.

void setup() {
    beginRAM(1024);  // initializes the RAM memory with a size of 1024 bytes and a data width of 1 byte
}

void loop() {
}

Notes and Warnings

  • The beginRAM() function must be called only once in the setup.
  • The byte_width parameter is optional, and if not specified, the default value is 1 byte.
  • This memory is volatile, so the data will be lost when the power is turned off, reset, or iCircuit is closed.
  • To get the real size of the RAM in bytes, multiply the size parameter by the byte_width parameter.