Personal computing discussed

Moderators: SecretSquirrel, just brew it!

Topic Author
Posts: 18
Joined: Thu Feb 24, 2011 2:36 am
Location: Australia

Help with coding arduino

Wed May 14, 2014 6:46 pm


I am new to Ardunio and havent coded in 10 years, not really sure what I am doing and require some assistance.

What I am trying to do is to have a program read a text file from an SD card, one line at a time, store that line as a variable. Then compare the text ( a time ) to a DS1307 RTC. When the time matches, read the next line of the text file which is a mp3 filename. Then play that file, and read the next line which is another time etc etc.

I am using the SD.h library, and can read a file and output to serial (I dont actually need serial in the end, just using it for debugging). I can't find a resourse that shows how I can read just one line at a time and store it as a variable. (filtered internet at work)

I'm sure I'll need more help later but this will help for now.

P.S I haven't actually made the text file yet so I can modify how the program will work to a more efficient workflow. I'm open to ideas.

Thanks in advance.

EDIT: Well I have solved this one... Decided to look at characters rather than lines, since my data set (text) will all be constant sizes.

char file_contents[16];
int index=0;
int data_size=16;, data_size);

Now I just have to figure out how to use the index properly to start the next capture of characters after the previous set.

Who is online

Users browsing this forum: No registered users and 1 guest