2019-11-04 at 5:14 PM #13303
I am trying to log data from a conductivity sensor to the SD card, for some reason it is not working. here is my code (I try to use code snippet but I could not make it look like how it suppose to be, I will try again when I am not too busy):
//Digital pin 12 is the MicroSD slave select pin on the Mayfly
#define SD_SS_PIN 12
//The data log file
#define FILE_NAME “Conductivity.txt”
//Data header (these lines get written to the beginning of a file when it’s created)
#define LOGGERNAME “Mayfly microSD Card Tester”
#define DATA_HEADER “Conductivity.txt”
int pin12 = 12;
Division = 0.0048875;
Serial.println(“SD card on”);
Serial.println(“SD card activation failed”);
volta = analogRead(A3);
float voltage = (volta)*(Division);
File Conductivity1 = SD.open(“Conductivity.txt”,FILE_WRITE);
Serial.println(“Conductivity = “);
Conductivity1.println(“Conductivity = “);
Please may everybody tell me what I am doing wrong, i would appreciate.
2019-11-08 at 6:03 PM #13315
I thinkC++1File Conductivity1 = SD.open(“Conductivity.txt”,FILE_WRITE);
should beC++1Conductivity1 = SD.open(“Conductivity.txt”,FILE_WRITE);
You also should have aC++1Conductivity1.close()
before the last delay.
Are you using a Mayfly? Are you using the built-in microSD card slot or the vertical adapter? What output do you get?
Did you ever get your program in your earlier thread to write to the SD card?
You must be logged in to reply to this topic.