sensebox / React-Ardublockly

This repository contains the new senseBox learn- and programming environment powered by google Blockly and React
Apache License 2.0
2 stars 6 forks source link

[Blockly][Codegenerator] Adjust SD-Card when MCU-S2 is selected #258

Closed Thiemann96 closed 5 months ago

Thiemann96 commented 7 months ago

Needs to be adjusted to this example. The code in blockly somehow breaks the MCU where you have to manually reset it

Thiemann96 commented 7 months ago
#include "SD.h"
#include "SPI.h"

void writeFile(fs::FS &fs, const char * path, const char * message){
    Serial.printf("Writing file: %s\n", path);
    File file = fs.open(path, FILE_WRITE);
    file.close();
}

void setup() {
  // put your setup code here, to run once:
      pinMode(SD_ENABLE,OUTPUT);
      digitalWrite(SD_ENABLE,LOW);
      SPIClass sdspi = SPIClass();
      sdspi.begin(VSPI_SCLK,VSPI_MISO,VSPI_MOSI,VSPI_SS);
      writeFile(SD, "/hello.txt", "Hello ");
}

void loop() {
  // put your main code here, to run repeatedly:

}