Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9873 Discussions

Preparing an SD card for a data file to be read by an Arduino sketch

bbro
New Contributor I
996 Views

From a previous discussion, I successfully put a standard Yocto image on my SD card which allows me to use my Gen2 Galileo as an Arduino. The blink and wifi example sketches work great. So now I want to experiment with reading a data file. So do I simply create a comma delimited text file on the same SD card along side the other five Yocto image files or what?

Thanks

RoboBill

1 Solution
FTinetti
Honored Contributor I
161 Views

Hi RoboBill,

I assume by

RoboBill wrote:

From a previous discussion, I successfully put a standard Yocto image on my SD card which allows me to use my Gen2 Galileo as an Arduino.

you meant the one described at http://www.intel.com/content/www/us/en/support/boards-and-kits/intel-galileo-boards/000006416.html SD Card Setup and Sketch Persistent for Boards and Kits, right?

RoboBill wrote:

So now I want to experiment with reading a data file. So do I simply create a comma delimited text file on the same SD card along side the other five Yocto image files or what?

If you want to read that file from a sketch then the answer is yes. Take into account, however, you will see the file in the place where the SD card filesystem is mounted in this Linux, which usually is

/media/mmcblk0p1

i.e. if you create a file test.txt in the SD card it is going to be readable from a sketch as

/media/mmcblk0p1/test.txt

as a regular file, actually, using (Linux) regular file operations.

HTH,

Fernando.

View solution in original post

2 Replies
FTinetti
Honored Contributor I
162 Views

Hi RoboBill,

I assume by

RoboBill wrote:

From a previous discussion, I successfully put a standard Yocto image on my SD card which allows me to use my Gen2 Galileo as an Arduino.

you meant the one described at http://www.intel.com/content/www/us/en/support/boards-and-kits/intel-galileo-boards/000006416.html SD Card Setup and Sketch Persistent for Boards and Kits, right?

RoboBill wrote:

So now I want to experiment with reading a data file. So do I simply create a comma delimited text file on the same SD card along side the other five Yocto image files or what?

If you want to read that file from a sketch then the answer is yes. Take into account, however, you will see the file in the place where the SD card filesystem is mounted in this Linux, which usually is

/media/mmcblk0p1

i.e. if you create a file test.txt in the SD card it is going to be readable from a sketch as

/media/mmcblk0p1/test.txt

as a regular file, actually, using (Linux) regular file operations.

HTH,

Fernando.

bbro
New Contributor I
161 Views

HI Fernando,

The discussion I was referring to was one of my own http://https//communities.intel.com/thread/97422?sr=inbox&ru=571031 Getting wifi sketch to recognize Galileo wifi.

So yes everything worked fine. I put a blank test.txt file on the SD card and compiled the ReadWrite.ino file without any changes.

Many thanks,

RoboBill

Reply