Why i can compile code with obvious error

Just like in topic i have problem because i can compile any code and i dont know what i compile and load to WIO Terminal. For example thi is code i tried compile:

#include <SPI.h>
#include <Seeed_FS.h>
#include "SD/Seeed_SD.h"
File Array;
String name= "WeatherLog.csv"
void setup(){
Serial(115200);

while(!Serial){
}
Setial.print("Initialize SDCARD");
if(!SD.begin(SDCARD_SS_PIN SDCARD_SPI)){
  Serial.println("SDCARD initialization failed. Reset Wio Terminal");
  while(1);
}
Serial.println("Initialization Done");
}
void loop(){
Array= SD.open(name, FILE_APPEND);
Array.print("l");
Array.print(",");
Aray.priln("x") 

Array.close();
}

its missing Semicolon and have few miss spell but still i can compile. After i upload code Wio Terminal behave like was old program. When i check IDE/WIOTerminal using basic examples it works fine.

Welcome to the forum

As your question does not relate to the operation of the IDE itself it has been moved to the Programming Questions category of the forum

String name = "WeatherLog.csv" void setup()

Are you sure ?

Start by fixing the obvious errors

A test says otherwise.

arduino-cli compile -b arduino:avr:uno --warnings all --output-dir ~/tmp --no-color (in directory: /home/me/Documents/sketchbook/Uno_R3/test)
In file included from /home/me/Documents/sketchbook/Uno_R3/test/test.ino:3:0:
/home/me/Documents/sketchbook/libraries/Seeed_Arduino_FS/src/SD/Seeed_SD.h:36:73: warning: overflow in implicit constant conversion [-Woverflow]
         boolean begin(uint8_t ssPin = 11, SPIClass& spi = SPI, int hz = 4000000);
                                                                         ^~~~~~~
/home/me/Documents/sketchbook/Uno_R3/test/test.ino:6:1: error: expected ',' or ';' before 'void'
 void setup(){
 ^~~~
/home/me/Documents/sketchbook/Uno_R3/test/test.ino: In function 'void loop()':
/home/me/Documents/sketchbook/Uno_R3/test/test.ino:22:1: error: 'Aray' was not declared in this scope
 Aray.priln("x")
 ^~~~
/home/me/Documents/sketchbook/Uno_R3/test/test.ino:22:1: note: suggested alternative: 'Array'
 Aray.priln("x")
 ^~~~
 Array
Used library     Version Path
SPI              1.0     /home/me/.arduino15/packages/arduino/hardware/avr/1.8.3/libraries/SPI
Seeed Arduino FS 2.1.1   /home/me/Documents/sketchbook/libraries/Seeed_Arduino_FS
Used platform Version Path
arduino:avr   1.8.3   /home/me/.arduino15/packages/arduino/hardware/avr/1.8.3
Error during build: exit status 1
Compilation failed.

Watch this https://www.youtube.com/watch?v=B2Sth6UhW-o maybe you will start understand a problem. I know i have obvious erros i made them specially an i dont know what happend.

The focus, the lack thereof, leaves much to be desired.

the ino is read only..
that's why it pops up asking for a new name as your changes can not be saved..
change the attribs on the file..

happy coding.. ~q

Of course you can. To learn what the compiler complains about, read the error messages that it emits .

Open the IDE preferences and set the compile option to "verbose" to see all of them.

#include <SPI.h>
#include <Seeed_FS.h>
#include "SD/Seeed_SD.h"
File Array;
String name= "WeatherLog.csv" ;
void setup(){
Serial.begin(115200);

while(!Serial){
}
Serial.print("Initialize SDCARD");
if(!SD.begin(SDCARD_SS_PIN SDCARD_SPI)){
Serial.println("SDCARD initialization failed. Reset Wio Terminal");
}
Serial.println("Initialization Done");
}
void loop(){
Array= SD.open(name, FILE_APPEND);
Array.print("l");
Array.print(",");
Array.print("x");
Array.close();
}

@boma106

When posting code, please use code tags as described in How to get the best out of this forum.

the ino is read only..

In Arduino 1.x, modifications to a read-only sketch would still be written to the appropriate tmp files and compiled. I hope that hasn't changed in 2.x?

OTOH, if you click the "upload" button after "breaking" a sketch that you compiled, the IDE will ("may?") upload the previous binary, even though the compile itself failed. The "compile failed" message can get "lost" as the info from the upload fills your window... (Hmm. I'm pretty sure I've had this happen to me, but I'm having trouble duplicating the behavior.)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.