Thanks for the reactions! it was very useful. ![]()
I decided to use the streaming library because it is super easy to use!
btw i have deleted the Serial.prints but i needed it also for some dataprints to SD
File dataFile = SD.open(fileName, FILE_WRITE);
if (dataFile) {
if (localtimeB < 10 ) {
dataFile << "" << "Localtime: " << localtimeA << ":" << "0" << localtimeB << "\n" << endl;}
else{
dataFile << "" << "Localtime: " << localtimeA << ":" << localtimeB << "\n" << endl;}
dataFile << "" << "Sensor1 Humidity: " << humidity << " %\t " << "Temperature: " << temp_c << " *C\n" << endl;
dataFile << "" << "Sensor2 Humidity: " << humidity2 << " %\t " << "Temperature: " << temp_c2 << " *C\n" << endl;
dataFile << "" << "Sensor3 Humidity: " << humidity3 << " %\t " << "Temperature: " << temp_c3 << " *C\n" << endl;
dataFile.close();
}
I couldn't figure out how the sprintf works for the time to ad a 0, but i solved is with a if.
Jan