You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I haven't got the breakout yet, so I'm struggling to debug exactly why it's working on a Pico but not the Wifi.

    You could maybe try adding a timeout after setting up the SD card - that's about the only thing I can think would really be different. You're using hardware SPI so it'd not like it'll be going too fast or anything.

    function onInit() {
     console.log("Connected!");
     // Wire up up MOSI, MISO, SCK and CS pins (along with 3.3v and GND)
     SPI1.setup({mosi:B5, miso:B4, sck:B3});
     E.connectSDCard(SPI1, B6 /*CS*/);
     setTimeout(function(){
      // see what's on the device
      console.log(require("fs").readdirSync())­;  
      for (var i in files)
        console.log("Found file "+files[i]);
      var f = E.openFile("log.txt", "w");
      f.write("Testing 123");
      f.close();
      
      f = E.openFile("log.txt", "r");
      f.pipe(console.log);
      f.close();
     },2000);
    }
    
About

Avatar for Gordon @Gordon started