Thin Ice Final Project Part 2

The first issue that I was facing the was the four buttons. When I connected all four buttons the same way I tested to see if they would work, I believe my circuit was short-circuiting. The OLED would display what it was supposed to, but as soon as I pressed a button, the entire thing would reset. I tried many several ways in correcting this issue. First I thought it was because I was using too many in parallel, so the resistors would block out the current. This could be the reason but I have no idea. Then I thought it was because all the wiring was too close, so the poor breadboard was at its ends-meet. In the end, it was basically I didn’t need the resistors in the first place. The reason for it being able to work is because Arduino has built in resistance, which can be called by “PULLUP” when defining pinMode. With the circuit being able to turn on and have buttons that do things—I was able to run the Tetris code! This was a gratifying moment for me.
But then the worse came – the code. I initially was going to code everything myself, but then my good friend suggested that I use ChatGPT. I think I went through several iterations of the code before realizing that the reason the some of the things that I wanted to work wouldn’t because the Arduino simply isn’t powerful enough. There is just too little memory for everything that I wanted the code to do. I spent a little too long trying to figure out why the code and display weren’t updating when the player reached the end block (Thank you Pat for being so wise). To remind you, I wanted the code to have three or so levels. The way I wanted to do this was have different “maps” which utilized characters. These are maps which I decided based on the original game. See below for what I was going for:

//Level 1
//x is outside the map
//b are ice blocks, boundaries
//1 is the player starting pos
//o are open blocks to the player (but become “b” when stepping on and then off
//2 is the ending position of the player, goes to the next round

//Level 2 –

//Level 3

Characters are especially memory-hoarders on Arduinos, so I unfortunately can’t get it to work. So basically I am restricted to a single level, I think anyway. I am not sure how the tetris code works because it is a lot longer and more complex but I really don’t want to keep being frustrated with it.
My first level was just a line. The player moves left for 8 spaces. After this sad realization of a single level game, I didn’t want it to be a single button game either. So I ended up just making the level just a bunch of free-spaces. When the player reaches the end-block, they win! It’s quite a fun game, for a second.

There are a couple bugs which I still have yet to figure out. To move, the player has to hit any of the buttons a couple times being they actually start to move. In addition, the starting block does not get recogized as a “visited” block once moved off from it. I am sure this is a relatively easy fix, but I can longer look at the code at this moment or I will cry.



Another issue that I never really got to was the housing. At the time of this post, there is no cute housing. I have been heavily focusing on its functionality (as well as being a Senior Design slave….). I also realized that it would be way easier to make something compact and look ~aesthetic~ if I got a PCB. Though I am not a fan of Eagle and PCB design…I am also not the biggest fan of SolidWorks so perhaps another reason I haven’t gotten to the housing was because I have already experienced much anguish with this project that CAD would tip the glass over….Once senior design expo is done, I will probably start on the CAD for this class’ expo.

Overall, I feel as if I have learnt a lot from this project. The most being that circuits suck and there is a reason why I hated them for so long. I don’t feel like that anymore, because it was still quite fun!




Previous Post
Street Racing Steering Wheel Final Report: Part 2
Next Post
Final Report part 2: Guitar Pedal

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.