#include #include "Adafruit_FRAM_I2C.h" /* Connect SCL to analog 5 Connect SDA to analog 4 Connect VDD to 5.0V DC Connect GROUND to common ground */ Adafruit_FRAM_I2C fram = Adafruit_FRAM_I2C(); uint16_t framAddr = 0; void writeByte(uint16_t pos,uint8_t value) { fram.write8(pos,value); Serial.print("Write Byte: "); Serial.println(value, HEX); } uint8_t readByte(uint16_t pos){ uint8_t value; value = fram.read8(pos); Serial.print("Read Byte: "); Serial.println(value, HEX); return value; } void dump(){ uint8_t value; for (uint16_t a = 0; a < 32768; a++) { value = fram.read8(a); if ((a % 32) == 0) { Serial.print("\n 0x"); Serial.print(a, HEX); Serial.print(": "); } Serial.print("0x"); if (value < 0x1) Serial.print('0'); Serial.print(value, HEX); Serial.print(" "); } } void setup() { // Check code Serial.begin(9600); if (fram.begin()) { // you can stick the new i2c addr in here, e.g. begin(0x51); Serial.println("Found I2C FRAM"); } else { Serial.println("No I2C FRAM found ... check your connections\r\n"); while (1); } uint8_t letter = 82; writeByte(0x0,letter); dump(); } void loop() { // put your main code here, to run repeatedly: }