Strana 70 z 73
Poznámky redaktora
"
"Temp_Battery.Current (A).println("Nový log: String(curFile));
} else {
Serial.openNextFile();
}
root.exists(curFile));
File SD.csv"
if (n.Temp_Motor.15;
}
String floatToStringComma(float value, uint8_t decimals) {
char buf[24]; dtostrf(value, decimals, buf);
String s(buf); s.Roll (deg).', ','); return s;
}
void bmiAutoCalibrate() {
Wire.Accel Z.println("BMI160 auto-kalibrace dokončena");
}
// ---------- utilities ----------
void findLastIndex() {
fileIndex 0;
File root SD.Accel X.Ay (m/s2).open("/");
File root.Gyro Z.0 (NOMINAL_TEMPERATURE 273.close();
Serial.substring(9, 12).startsWith("/datalog_") n.replace('.Az (m/s2).70
// ---------- CSV hlavička ----------
const char *CSV_HEADER =
"Time (ms).Temp_Ambient";
// ---------- pomocné funkce ----------
float getTemperature(int pin) {
float voltage analogRead(pin) (3.beginTransmission(0x68);
Wire.open(curFile, FILE_WRITE);
if (f) f."
"Ax (m/s2).name(); "/datalog_123.0);
float resistance (SERIES_RESISTOR (3.write(0x37); Wire.println(CSV_HEADER); f.close();
}
void createNewLogFile() {
do fileIndex++; sprintf(curFile, "/datalog_%03u.endTransmission();
delay(1000);
Serial.endsWith(".openNextFile();
while (f) {
String f."
"Gyro X.Gyro Y.15);
return (1.csv", fileIndex); }
while (SD.println("Chyba tvorby logu!");
}
}
.0 st) 273.Voltage (V).length()
== 15) {
uint16_t idx n.csv") n.write(0x7E); Wire.Pitch (deg).3 voltage)) voltage;
float log(resistance NOMINAL_RESISTANCE) /
BETA_COEFFICIENT;
st 1.close();
f root.3 4095.Energy (Wh).Accel Y.Power (W).toInt();
if (idx fileIndex) fileIndex idx;
}
f