Skip to content

writeEUI()

Arnd edited this page Jan 6, 2021 · 1 revision

Function writes any data type to the MCP7940's special 8 bytes of protected memory. Any writes outside of the valid address space are ignored. Internally this function issues the special commands that unlock this normally protected memory area before changing the value


Example:

...
MCP7940_Class MCP7940;        // Create an instance of the MCP7940
...
  char buffer[6] = "Hello!"; // create and fill a character buffer
  MCP7940.writeEUI(0,buffer); // write it to position 0 in the buffer
  MCP7940.readEUI(0,buffer); // read it back from the MCP7940
  Serial.print("Buffer is \"");
  Serial.print(buffer);
  Serial.println("\".");
...