I decided to create an old-school Snake, because I wanted to learn Arduino in a more advanced project using many components. At first, it seemed to be really complicated, as I was new to Arduino, but at the end I realized that it's not complicated at all, as I got used to how Arduino and it's components work. My version shows the current score on the 4-digit display + play music before and after the game. Of course you can loose the other components and make it just clear Snake game, I think the changes in code would not be that difficult.
Uploading .WAV files to SD cardI spent most of the time figuring out how to play WAV files from the SD card in the speaker. I came up with a solution that worked for me.
First you have to convert the sound file (mp3, wav...) to a specific format. For that I used this online convertor
Other settings unfortunately did not work for me.
WiringThere are pictures how I connected all the components. I am sorry there is not a scheme, I think it would be more confusing than anything else. I used Arduino Mega 2560 as I mentioned before, but it is surely replaceable by another type. You will just have to figure out where to eventually connect the speaker or the SD card, because the pins will probably differ.
CodeI will not talk/write about the code here, because I have many comments in the code itself
ConclusionIn case you are trying to reproduce it or you are working on something similar, do not hesitate to ask me anything. I will be happy to help, if I will be capable of doing so.
Comments
Please log in or sign up to comment.