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