Hi
I've followed an SD card tutorial, I've got the '#include <SD.h>' at the start, but it returns the error
'SD' not declared in this scope
and it highlights;
if(!SD.begin(CS_pin))
Any thoughts? Cheers
Hi
I've followed an SD card tutorial, I've got the '#include <SD.h>' at the start, but it returns the error
'SD' not declared in this scope
and it highlights;
if(!SD.begin(CS_pin))
Any thoughts? Cheers
(deleted)
And post the error messages you are getting.
Ideally both code and error messages wrapped in tags.
[#inlude <SD.h>
int CS_pin = 10;
int pow_pin = 8;
void setup()
{
Serial.begin(9600);
Serial.println("Initializing card");
pinMode(CS_pin, OUTPUT);
pinMode(pow_pin, OUTPUT);
digitalWrite(pow_pin, HIGH);
if(!SD.begin(CS_pin))
{
Serial.println("Card Failed");
return;
}
Serial.println("Card Ready");
}
void loop()
{
String datastring = "Testing 123");
File dataFile = SD.open("First test.txt", FILE_WRITE);
if(dataFile)
{
dataFile.println(datastring);
dataFile.close();
Serial.println(datastring);
}
else
{
Serial.println("Couldn't access file");
}
delay(5000);
}]
The error message is 'SD' was not declared in this scope.
Highlighting the SD of;
if(!SD.begin(CS_pin))
Thanks.
#inlude <SD.h>
D'oh