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