Skip to content

writeRAM()

Arnd edited this page Aug 6, 2017 · 4 revisions

Function writes either a single byte or a number of consecutive bytes to the MCP7940's 64 bytes of SRAM memory. Writes outside of the valid address space are ignored.


Example:

...
MCP7940_Class MCP7940;        // Create an instance of the MCP7940
...
  char buffer[13] = "Hello there!"; // create and fill a character buffer
  MCP7940.writeRAM(10,13,buffer); // write it to position 10 in the buffer
  MCP7940.readRAM(10,13,buffer); // read it back from the MCP7940
  Serial.print("Buffer is \"");
  Serial.print(buffer);
  Serial.println("\".");
  MCP7940.writeRAM(10,"X");
...
Clone this wiki locally