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