-- John Longworth December 2017 -- Write some text to EEPROM -- Uses I2C module local id, sda, scl, device = 0, 3, 4, 0x50 i2c.setup(id, sda, scl, i2c.SLOW) -- Initialise I2C function WriteEE(memloc, data) addrh=bit.rshift(memloc, 8) addrl=bit.band(memloc,0xff) i2c.start(id) i2c.address(id, device, i2c.TRANSMITTER) i2c.write(id, addrh) i2c.write(id, addrl) i2c.write(id,string.byte(data)) i2c.stop(id) end buffer = "Go placidly amid the noise and the haste, and remember ".. "what peace there may be in silence. As far as possible, without ".. "surrender, be on good terms with all persons.".. "Speak your truth quietly and clearly; and listen to others, ".. "even to the dull and the ignorant; they too have their story." print(#buffer) --print(string.sub (buffer, 1 , 40)) --print(string.sub (buffer, 4 , 11)) --print (buffer) WriteEE(0x00," ") for p = 1, #buffer do edat = string.sub(buffer,p,p) --print("edat "..edat) tmr.delay(5000) WriteEE(p,edat) end