You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Oh - actually forget that. It's not a problem at all.

    Basically if you have nothing in FlashEEPROM at that location, f.read will return undefined.

    So f.read(0) returns undefined, and E.toString complains because it's given undefined.

    Try:

    var eepromcontents = f.read(0);
    if (eepromcontents!==undefined) {
      var str = E.toString(eepromcontents);
      ...
    }
    

    Or make sure you do f.write(0,"Hello") first to put something in there - but personally it'd be good practice to check anyway.

About

Avatar for Gordon @Gordon started