-2

anyone can help me please to fix this error when I try to compilate says File does not exsist. It would be great if anyone can post the entirely code.

Link of code below if anyone can help me please:

https://create.arduino.cc/editor/Jawad2001/5ea57339-7ca1-4f8d-ab00-f4f1aa639209/preview

error: expected')' before 'f'

Sorry I'm new at this sorry for the annoyances.

Thanks For all your Help.

  • #include <SD.h>; – Juraj Feb 17 at 15:50
  • I don't know why but says expected initializer before "." token – jawad bouhali Feb 17 at 16:54
  • sorry, without ;. it should be #include <SD.h> – Juraj Feb 17 at 17:07
  • I know but i did it without ; – jawad bouhali Feb 17 at 17:22
  • i don't know why but the program says the error is in Filedata2.txt – jawad bouhali Feb 17 at 17:22
0

Here are several things I can see from your code that cause most of the error messages.

1) You declare

File data_txt;
File data2_txt;

but you later use data_file and data_file2. This is why you see the "not declared in this scope" errors.

2) You do not properly define the functions getData() and getData2(). You start with the definition of getData2() inside the function getData().
First finish the function getData() by closing all brackets you opened and then define the function getData2(), like this:

void getData() {
//the code of getData() goes here....
}

void getData2() {
//the code of getData2() goes here....
}

3) I assume you want to write to data_file in getData() and to data_file2 in getData2()?! Nevertheless, you also use data_file in getData2().

Update after your edit:

Regarding the compilation error, you do not open a curly bracket

{

after getData2().

However, there are several other issues that will lead to problems, even if it finally does compile without problems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.