-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.

11
  • #include <SD.h>;
    – Juraj
    Commented Feb 17, 2019 at 15:50
  • I don't know why but says expected initializer before "." token
    – Some One
    Commented Feb 17, 2019 at 16:54
  • sorry, without ;. it should be #include <SD.h>
    – Juraj
    Commented Feb 17, 2019 at 17:07
  • 1
    It helped but now i have other problem in void get data
    – Some One
    Commented Feb 17, 2019 at 17:38
  • 1
    data_file was not declared in this scope i publicated the new errors
    – Some One
    Commented Feb 17, 2019 at 17:38

1 Answer 1

1

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 and acknowledge you have read our privacy policy.

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