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