Romilly Cocking
/
Ser23K256Example
Example for Microchip 23K256
main.cpp
- Committer:
- romilly
- Date:
- 2010-08-15
- Revision:
- 0:0e31c6068b47
File content as of revision 0:0e31c6068b47:
#include "mbed.h" #include "Ser23K256.h" SPI spi(p5,p6,p7); Ser23K256 sram(spi,p14); int main() { char buff[50]; sram.write(0, 'h'); sram.write(1, 'i'); sram.write(2, '!'); sram.write(3, '\0'); for (int address = 0; address < 4; address++) { buff[address] = sram.read(address); } printf("sram = %s\r\n", buff); sram.write(0, "Hello world!",12); sram.read(0, buff, 12); buff[12]='\0'; printf("now = %s\r\n", buff); }