Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C12832_lcd LM75B MMA7660 mbed
Fork of Snake by
Snake Game for bad eyes
I compiled it and found it a bit annoyingly hard to actually play, and my eyes are not that good. So spent an hour or so addressing 2 issues, the game is always the same because it uses a random seed that never changes.
1. So I decided to use the classic approach, of temperature, but because the temp sensor is 11 bit and runs in .125 degree increments, which , although sensitive is not really very noisy enough for a random seed. So the accelerometer gets added into the randomised value mix in my adaptation.
2. Along with a slightly larger fruit, since 1 pixel is far too tiny to see in this LCD.
3. I renamed a few variables from German to English. My German is almost non existent, but renaming made for easier parsing since this is the first ever mbed code I am writing, hence my effort to document it.
If we were to go to town, the best code changes would be to make the snake 3 pixels fat, and maybe even add stripes, like in the 3310 version, and variations. Make the fruit a better circle, and add a scoreboard on the side. A fresnel lens on top might totally go all the way. If you have time, perhaps see if one can use LCD refresh rate to paint in 2 shades, might require using some DMA channel code ,learning to create a back buffer for the edgy coder who has more time than sense. Right now working on a touch triggered doorbell, so hope to let my first project just sit for now as a starting place.
