Reading form an SD card

Hello everyone,

I have a project called: Puzzle Me Chess
Description:
Create a physical chess puzzle on a chess board. This board will have user checkability and software mapped defined chess puzzles. At first there will be 3 different chess puzzles ranging from easy to hard. There will be an OLED screen to show the user where to put the prices to set up the chess puzzle. This project will also have a feature to show user hint or show asnwer. After completing the puzzle a sound will play to tell the user he/she has completed the puzzle.

This is my first Arduino project, I'm using a Teensy 3.6 and I first want to learn how to read from an SD card.

My goal is to have a 8x8 csv file that will have chess piece inside a block.

Example:
8
7
6 WK
5
4 BP
3
2
1
a b c d e f g h

There would be a possible 64 values I would want to pull off from the SD Card but at max I would only be using 32 (one for each piece).

In most cases I would use 10-20 pieces. I would need to take the x and y value of each box in the csv file that has something written in the spot
an example would be b4BP which stands for b4 the x&y and BP then Black pawn. This would then be displayed on an OLED and the user can put that piece in that spot. I would then need to be able to tell if there is nothing in that spot and not count and or use that block.

Does anyone have a place to start? I have a test csv file that kinda looks like the one above, but how do I read from it? is there library's I need?

Thank you for your help in advanced,

Joe

Just want to add this hear incase anyone else comes across this issue and needs help.

I was able to get this working with the SD.h and SPI.h library's. I'm currently using the Platform.io and teensy 3.6.

Follow this example if you want to get your internal SD card working.

setting const int chipSelect = BUILTIN_SDCARD; got it working ! Now to learn how to read a folder and file from the SD card

Thank you for reading,
Joe

consider the merits of using a two dimensional array to store the data

Thank you Geek Emeritus this is a big step in helping me work on a solution !!

I will look at this soon and try to get it working !

Joe

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.