-
Notifications
You must be signed in to change notification settings - Fork 0
/
gravar.h
50 lines (44 loc) · 1.07 KB
/
gravar.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
SD card read/write
This example shows how to read and write data to and from an SD card file
The circuit:
* SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK - pin 13
** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)
created Nov 2010
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe
This example code is in the public domain.
*/
#ifndef gravar_h
#define gravar_h
#include <SPI.h>
#include <SD.h>
#include "fila_.h"
File myFile;
ISR (PCINT2_vect)
{
// if the file opened okay, write to it:
if(!myFile){
myFile = SD.open("newtest.txt", FILE_WRITE);
}
if (myFile) {
//Serial.println("Writing to test.txt...");
//int inicio = micros();
myFile.write(fila,256);
//Serial.println("tamanho");
//Serial.println(tamanho);
//int fim = micros();
//Serial.println(fim-inicio);
//Serial.println("Interrupcao");
// myFile.flush();
}
else {
// if the file didn't open, print an error:
//Serial.println("error opening test.txt");
}
}
#endif gravar_h