#include <Wire.h>
#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:
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}