Assignment 6: Arduino Introduction
During this assignment, we are introduced to Arduino. Arduino is a small computer that a user can upload code to, to execute a task. For example, if one wanted to make a light switch, one could make it so that once a switch was hit, an LED would turn on. What one would have to do to an Arduino to make this happen is tell the Arduino (in C++) to allow power through a certain channel when the switch is turned on. Arduino can be as complex or as simple as you want it to be. For this reason, Arduino has a low barrier to entry, anyone can use it.
I actually messed up and did not take any pictures of what I was doing during the lab so I will try and explain it all. Once we were given free reign to explore our options for Arduino, I examined a bunch of sensors. The fire sensor seemed the most comical but I did not have a flame source for it to detect. This lead me to discover the joystick and button sensors. Given my background of game design, I settled with these sensors. For the output of the game, I chose the 16×2 LCD screen.
For the next hour in lab, I got nothing done. Not because I did not feel like doing work, but I couldn’t find any help online. I only wanted to power/control the LCD screen. Every tutorial for the LCD screen never showed how they plugged the jumper cables in. The text tutorials didn’t help either, they never specified what board they used (it matters!). I managed to find a proper tutorial once I explicitly searched “16×2 LCD screen Arduino Uno.” Overall, learning how to search for the information I needed was the only piece of knowledge I took out of that lab time (not bad!).
Moving on, I messed around with the arduino a bunch in my free time. Most of the time I was just trying to get inspiration. At this point I had a slew of ideas, but didn’t know what was possible for me. A couple of the ideas were: a virtual keyboard, choose your own adventure, and a simple platformer. Once I found out how to upload text properly to the LCD I had an epiphany about a simple yet dynamic way to make a choose your own adventure game.
Choose Your Own Adventure “The True Dichotomy” – Storyboard
“The True Dichotomy” is a chose your own adventure game that only used two buttons as the form of input. In the panels, when the LCD is telling the player “Right is ____, Left is _____”, the LCD is explaining to the player what the buttons mean now. When navigating, they mean no and yes. When in combat, they mean fight and defend. This could me modified in a myriad of ways, perhaps for an iterative assignment?
Here’s a bunch of photos.
Input being printed to LCD. 1 = button not pressed, 0 = button is pressed.
The moment when I had that epiphany.
Picture 1. When no is pressed once. Picture 2. When no is pressed again.
If I didn’t have to pay money for Arduino drafting software (TinkerCad didn’t have enough moduals), I would have made an image showing how I did my wiring. It’s nothing complex, I had a line for ground and line for power. The inputs were inserting directly into the pin holes. The importance of the two photos was to show that there is actual progression in the text when one of the buttons is pressed. WordPress wouldn’t let me past my code for security reasons so just click here. This setup would not work long term. I’m looking into a way to jump to points in the code using global variables as a point of reference.
Jeez, I haven’t touched C++ since high school. Coming back to C++ was just a frustrating as I thought it would be. Knowledge of other languages defiantly makes some of the process easier but makes other aspects even more frustrating. On the other hand, working with Arduino itself was a relatively new frontier. We have worked with circuits before but I still have trouble visualizing circuits in my head. It’s just something I need to tinker with to understand. Basically what I did for this assignment, tinker.
This assignment will be the one i choose to do an iteration on! I have this whole idea for an arcade cabinet that has the two buttons but three LCD screens. I plan on making a legit choose your own adventure game completely contained within the Arduino. I am thinking about buying a bigger LCD screen for more text while having two smaller LCD screens displaying what the two buttons currently do. This is going to be so cool if I pull it off! Once I find a good framework for my code, everything will fall into place.