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