Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SPI.h>
- #include <SD.h>
- File Plik;
- int odczytanaWartosc = 0;
- void setup()
- {
- Serial.begin(9600);
- while (!Serial)
- {
- ;
- }
- Serial.println("Wczytywanie karty SD");
- if (!SD.begin(8)) {
- Serial.println("Wczytywanie zakończone niepowodzeniem!!");
- return;
- }
- Serial.println("Udało się! Karta wykryta!");
- }
- void loop()
- {
- zapis();
- odczytanaWartosc = analogRead(A1); //Odczytujemy wartość napięcia
- Serial.println(odczytanaWartosc);
- }
- void zapis()
- {
- Plik = SD.open("test.txt", FILE_WRITE);
- Plik.println(odczytanaWartosc);
- Plik.close();
- delay(300);
- Serial.println("ZAPISANO!");
- }
Advertisement
Add Comment
Please, Sign In to add comment