Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*CS -> 4
- SCK -> 52
- MOSI -> 51
- MISO -> 50*/
- #include <SD.h>
- File file;
- String test;
- void setup() {
- Serial.begin(9600);
- Serial.print("Starting SD...");
- if(!SD.begin(4)) Serial.println("failed");
- else Serial.println("ok");
- file = SD.open("file.txt", FILE_WRITE);
- if(file){
- file.println("Je suis à la ligne une");
- file.print("Je suis SENCE être à la ligne 2");
- file.print(" Et moi à la suite mdr");
- file.close();
- }
- }
- void loop() {
- file = SD.open("file.txt", FILE_READ);
- if(file){
- test = file.read();
- file.close();
- }
- Serial.println(test);
- delay(5000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement