I am trying to read numbers off an SD card and I'm running into some trouble. I ran CardInfo and had no problems (I've attached the log below). On the SD card, frames.txt has only "200" inside it, and frame.txt has only "00000010". When I run my program, the Serial Monitor shows 48 for frame.txt (instead of 2) and shows 50 for frames.txt(instead of 200). Here is my code, where am I going wrong?
#include <SD.h>
File myFile;
void setup(){
Serial.begin(9600);
pinMode(10,OUTPUT);
if(!SD.begin(10))
Serial.println("Initialization failed.");
else
Serial.println("Initialization complete.");
myFile = SD.open("frames.txt");
if (myFile) {
Serial.println("frames.txt:");
}
else
Serial.println("failure");
byte k=myFile.read();
Serial.println(k);
}
void loop(){
}
CardInfo log:
Initializing SD card...Wiring is correct and a card is present.
Card type: SD1
Volume type is FAT16
Volume size (bytes): 513015808
Volume size (Kbytes): 500992
Volume size (Mbytes): 489
Files found on the card (name, date and size in bytes):
FRAMES.TXT 2013-06-14 16:34:44 3
MATRIX.TXT 2013-06-14 15:15:58 1924
FRAME.TXT 2013-06-14 16:36:22 8