Week 2 - Embedded Programming

Avoiding the mines

Cecilia Marsicovetere

This week we started embedded programming .

We got together to test different pipelines in arduino Uno, arduino Mega and Nucleo H743ZI2 my lab had lying around. We tested how to use the Arduino IDE and Visual Studio Code to program them. Logged in a shared google doc

Then on the lab, I did the soldering. I used the copper ones made in CBA to begin with. I am going to use the time honored tradition of blaming the tools for the quality of the soldering and not my lack of practice.

I also soldered the black silkmask option when the extra boards arrived on monday and I tried my best at the challenge, but could not manage to solder the 0201, I was defeated.

Anyway, after testing everything was soldered correctly using Quentin's example codes, I could get to work.

In the beginning, I tested using Adafruit's examples. I played around with the different examples and testcode available to understand how the display worked.

I decided to make a minesweeper game. I started looking into different projects to figure out how the logic of minesweeper. I read this arduino project and this implementation . I started taking notes to break down the different blocks of code I needed.

Unfortunately, I let a couple of days pass, as one does. I have not learned the documentation lesson quite yet, so the notes I had were not enough to get me back on track. Those days was enough to completely lose the thread of what I was doing.

As I struggled to think, I remembered I can ask the machine to think for me.

You can read the full conversation here but since I have prior experience coding I could follow along pretty well and just asked some clarifying questions. The full code is in this file, where you can see comments explaining the logic. Minesweeper is basically a grid of objects that can have four states: unknown, flagged, clear, or mine. In addition to this, the clear state would have a number indicated how many mines are adyacent to that object. The other layer of the game is the cursor, in order to have the player move around and select or flag part of the grid. The logic part did not stump me quite as much as the graphics did. It's hard to wrap my head around the position of the cursor in relation to other things and the resolution of the display. Overall. it's a fun simple game and I was amazed by how easy ChatGPT broke down the logic. This vibecoding business is really time saving. I did review the code, add comments, changed some minor things to make it clearer for myself, but it was mostly GPT-5 who pulled it off.

TODO: explain my simple code to test before chatgpt so i can prove i completed this assignment

TODO: add parts of the code and explain them

TODO: add video/picture of the final game working