-
Notifications
You must be signed in to change notification settings - Fork 2
put()
Arnd edited this page Dec 11, 2020
·
3 revisions
The put function writes the data in variable data starting at address. The data parameter may be any type of standard or user constructed variable, the size of the element is computed at runtime and the appropriate amount of data is written. If the memory written goes past the end of physical memory it automatically overflows back to the beginning of memory.
const uint8_t CS_PIN = 8; // define the CS/SS Pin used for SPI
MicrochipSRAM sram(CS_PIN); // Instantiate the class
char myText[12] = "Hello World"; // Text string to write to memory
sram.put(123,myText); // Write characters to memory
sram.get(123,myText); // Read from memory
Serial.print("Data is \""); // Display results
Serial.print(myText);
Serial.println("\"");