You are reading a single comment by @Jorgen and its replies. Click here to read the full conversation.
  • small example with SD card module connected to SPI1

    function onInit() {  
      // initial SPI1 for SDCard module
      SPI1.setup({sck:A5, miso:A6, mosi:A7 });
      E.connectSDCard(SPI1,B1/*CS*/);
      console.log(require("fs").readdirSync());
      require("fs").writeFileSync("hello.txt", "Hello World");
      console.log(require("fs").readFileSync("hello.txt")); // prints "Hello World"
      require("fs").appendFileSync("hello.txt", "!!!");
      console.log(require("fs").readFileSync("hello.txt")); // prints "Hello World!!!"
    }
    
    // call onInit() if it is first start
    onInit();
    
    
About

Avatar for Jorgen @Jorgen started