hello i have a problem with sd on arduino nano ,there's a code :
Serial.println("hhh");
for (int i = 0; i <= 82; i++) {
Serial.println(myList2[i]);
Serial.println(myList[i]);
}
Serial.println("hhh");
detachInterrupt(digitalPinToInterrupt(2));
detachInterrupt(digitalPinToInterrupt(3));
encoderPosition = 0;
Serial.println("ENCODER_POSTION0");
digitalWrite(5 , LOW);
przycisk = 0;
continue123 =0;
SD_WRITE = 1;
int liczba = EEPROM.read(0);
// Sprawdzenie, czy wartość jest zdefiniowana (niezapisana wartość EEPROM to 255)
if (liczba == 255) {
liczba = 0; // Ustawienie początkowej wartości na 0
} else {
liczba += 1; // Zwiększenie wartości o 1
}
// Zapisanie nowej wartości do EEPROM
EEPROM.write(0, liczba);
// Wyświetlenie wartości w Serial Monitor
Serial.print("Aktualna wartość: ");
Serial.println(liczba);
String fileName = "text" + String(liczba) + ".txt";
myFile = SD.open(fileName, FILE_WRITE);
if (myFile) {
//myFile.println("NEXT_TEST:");
Serial.println("Zapisywanie do karty sd...");
for (int i = 0; i <= 82; i++) {
Serial.println(float(myList[i]));
myFile.println(myList2[i]);
Serial.println(myList2[i]);
myFile.println(float(myList[i]));
}
digitalWrite(5 , HIGH);
myFile.close();
}
else{
Serial.println("error opening test.txt");
}
save_done = 1;
sd card is working normaly but only on mylist not mylist2 ?
There's a Mylist and Mylist2 typical values :
1354.00, 2763.00, 4172.00, 5580.00, 6990.00, 8398.00, 9807.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 9001.00, 8892.00, 7484.00, 6075.00, 4666.00, 3259.00, 1849.00, 441.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00
- Mylist2
0.44, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.44, 0.39, 0.44, 0.39, 0.39, 0.44, 0.44, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.44, 0.39, 0.34, 0.39, 0.39, 0.39, 0.44, 0.39, 0.39, 0.44, 0.49, 0.39, 0.39, 0.39, 0.44, 0.44, 0.39, 0.39, 0.39, 0.39, 0.39, 0.44, 0.44, 0.39, 0.44, 0.49, 0.44, 0.39, 0.44, 0.39, 0.44, 0.44, 0.44, 0.39, 0.44, 0.44, 0.39, 0.44, 0.44, 0.39, 0.44, 0.39, 0.39, 0.49, 0.34, 0.39, 0.34, 0.34, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00
-Mylist1
there's a definition of booth lists:
float myList[82] = {};
volatile long myList2[82] = {};
Please help -it's soo important to me ![]()