This is a slight mod of the source code uploaded by Sam Thys - Please check out the original project, this fork is only a hack of some working code to fix a few playability issues. See for a listing

Dependencies:   C12832_lcd LM75B MMA7660 mbed

Fork of Snake by Sam Thys

Snake Game for bad eyes

/media/uploads/zaphodikus/vs180708-003.jpg 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.

All wikipages