Thank you for the response.
Here's the code in it's entirety:
print("Before getFree()");
console.log(require( "Flash").getFree());
print("After getFree()");
var fs = require("fs");
if ( typeof(fs.readdirSync()) === 'undefined' ) {
console.log('Formatting FS');
E.flashFatFS({ format: true });
}
fs.writeFileSync("hello.txt", "Hello World");
console.log(fs.readFileSync("hello.txt")); // prints "Hello World"
fs.appendFileSync("hello.txt", "!!!");
console.log(fs.readFileSync("hello.txt")); // prints "Hello World!!!"
I put a couple of print statements in to delineate where the memory table should be printed.
The output from the code above is:
Before getFree()
[
{ "addr": 1114112, "length": 3080191 }
]
After getFree()
Uncaught Error: Unable to mount media : NO_FILESYSTEM
at line 6 col 28
if ( typeof(fs.readdirSync()) === 'undefined' ) {
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Thank you for the response.
Here's the code in it's entirety:
I put a couple of print statements in to delineate where the memory table should be printed.
The output from the code above is:
Before getFree()
[
{ "addr": 1114112, "length": 3080191 }
]
After getFree()
Uncaught Error: Unable to mount media : NO_FILESYSTEM
at line 6 col 28
if ( typeof(fs.readdirSync()) === 'undefined' ) {