#include "FS.h"
#include <SoftwareSerial.h>
SoftwareSerial s(D6,D5);
int flag = 0;
void setup() {
s.begin(9600);
Serial.begin(9600);
SPIFFS.begin();
SPIFFS.remove("/myFile.bin");
}
void loop() {
uint8_t buff[512];
File testFile = SPIFFS.open("/myFile.bin", "a+");
if (s.available()>0){
if (flag == 0){
char ch = s.read();
if (ch == ':'){
flag = 1;
}
}
else{
s.readBytes(buff, sizeof(buff));
//Serial.write(buff, sizeof(buff));
testFile.write(buff, sizeof(buff));
testFile.close();
}
}
}
Moderator: igrr