Elevator Pitch: The project is an accessible memory and strategy game designed for inclusive gameplay, merging technology and entertainment to create engaging experiences.
All body controls are done and the code should be 60% done.
Base of holding the controls is done, with the code being 80% done.
The controls and base should be connected together and aesthetics are done. Code should be 99% done.
Pray that nothing broke/ malfunctioned and the code and installation is all done.
The GIF shows that an Arduino can create a normal Simon game with colors. With that, I just need to alter the code to have it fit with the different controllers I'm using.
Test hardware first incase of any malfunctioning
Use computer instead of a Raspberry Pi for TV monitor
Look into a flex sensor instead of Hall Effect Sensor
Focus on making it one player, but keep it a two player game
Each sensor for the sequence now works individually by itself. The idea is to have each sensor be its own function as a do while loop.
It takes 20 turns (clicks) for the encoder to make a full 360 rotation around itself. So with that info, the code has it where no matter if you rotate it clockwise or counterclockwise, once it gets to -20/20, it starts all over. For the Encoder, when someone needs to rotate the leg for the sequence, the code is going to wait until the encoder rotates around starting back to -1/1, and then leave that function to go back into the main loop of the game.
//Sourced by: https://lastminuteengineers.com/rotary-encoder-arduino-tutorial/
// Rotary Encoder Inputs
#define CLK 2
#define DT 3
#define SW 4
int counter = 0;
int currentStateCLK;
int lastStateCLK;
String currentDir ="";
unsigned long lastButtonPress = 0;
void setup() {
// Set encoder pins as inputs
pinMode(CLK,INPUT);
pinMode(DT,INPUT);
pinMode(SW, INPUT_PULLUP);
// Setup Serial Monitor
Serial.begin(9600);
// Read the initial state of CLK
lastStateCLK = digitalRead(CLK);
}
void loop() {
do {
// Read the current state of CLK
currentStateCLK = digitalRead(CLK);
// If last and current state of CLK are different, then pulse occurred
// React to only 1 state change to avoid double count
if (currentStateCLK != lastStateCLK && currentStateCLK == 1){
// If the DT state is different than the CLK state then
// the encoder is rotating CCW so decrement
if (digitalRead(DT) != currentStateCLK) {
counter --;
currentDir ="CCW";
} else {
// Encoder is rotating CW so increment
counter ++;
currentDir ="CW";
}
Serial.print("Direction: ");
Serial.print(currentDir);
Serial.print(" | Counter: ");
Serial.println(counter);
}
// Remember last CLK state
lastStateCLK = currentStateCLK;
// Read the button state
int btnState = digitalRead(SW);
//If we detect LOW signal, button is pressed
if (btnState == LOW) {
//if 50ms have passed since last LOW pulse, it means that the
//button has been pressed, released and pressed again
if (millis() - lastButtonPress > 50) {
Serial.println("Button pressed!");
}
// Remember last button press event
lastButtonPress = millis();
}
// Put in a slight delay to help debounce the reading
delay(1);
}while(counter < 20 && counter > -20);
counter = 0;
}
The start of the sequence will have the hall effect starting at zero. That's when the magnet is touching the sensor. It will stay in this loop until the magnet is pulled away to where the sensor reads a one. Once it reads a one, it exits its loop and indicates they did that part of the sequence.
static int magnetpin = A0;
void setup() {
pinMode(magnetpin, INPUT);
Serial.begin(9600);
}
void loop() {
int value;
do{
value = digitalRead(magnetpin);
Serial.println(value);
delay(100);
}while(value == 0);
Serial.println("hair pulled");
}
Since there are two eyes, there will be two photocells. Both photocells need to reach at least 800 to consider that both eyes are closed. If only one eye is over 800, then it won't count. Once the eyes are considered closed, then it'll count as that part of the sequence completed.
int sensorPinL = A0; // select the analog input pin for the photoresistor
int sensorPinR = A1;
void setup() {
Serial.begin(9600);
}
void loop() {
do{
Serial.print(analogRead(sensorPinL));
Serial.print(", ");
Serial.println(analogRead(sensorPinR));
delay(200);
}while(analogRead(sensorPinL) < 800 || analogRead(sensorPinR) < 800);
Serial.println("Eyes Closed");
}
Both the Butt Smacking and the High Fiving will be using buttons. In this code, I just put them together for now, but in the real game, these will have their own function. So when it's their turn of the sequence, the game will just wait to see until the button is pressed and once it's pressed, it'll indicate that they completed that part of the sequence.
void setup() {
pinMode(5, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
Serial.begin(9600);
}
void loop() {
while(digitalRead(5) == HIGH){
}
Serial.println("Butt Smacked");
while(digitalRead(6) == HIGH){
}
Serial.println("High Five");
}
Combine the sensor codes within one code
Start making a cardboard layout of the game for user testing
Users At The Moment:
Ollie Kimlicko
Ash Duy
Tina Wong
Ollie suggests to use music and sound effects to have a better user experience with the game. Not only having the LEDs turning on to show you did the component correctly, but a silly sound to go with it as well. I do have the Arduino Instrument shield, but I need to find it...
I was worried about the durability of the game. I don't want the game to get destroyed after a couple of uses. So to help with that with at least the hand high five, use copper tape with wires instead of a button. It'll still work as a button and the code will be the same, but no worries of actually damaging a button.
Going off on what Ollie said, I found some sound effects that could be used for each sensor. I asked some people to give me their feedback on what sound they liked the most for each component. I'm waiting for more answers, but Tina was able to get back to me and give me her feedback.
Some written feedback she said was that she didn't like any of the high-five sound effects, but chose a sound that was best from the options. She also suggests that the sound she picked for the eyes, to have it be repeated to sound like a double blink instead of one.
I added all the sensors to the arduino and added LEDs to be connected with each sensor so I'm able to see if the game is able to "show" the sequence it wants the player to do. It is able to do that, but when I try to repeat the sequence, the LEDs don't light up again to see if I completed that task. So I need to work on that and hopefully within this week have pretty much have the coding of the game done.
Get the LEDs and sensors working together and have a working game code with all the sensors.
There are some minor fixes with timing, but those are easy fixes. I need to change the code a little for the hall effect sensor. At the moment it is going off when the mgnet appears and not when it's away. I'll change that when im able to have the magent next to the sensor consistently.
I debated between either doing a Zombie or Robot theme to the game. I was leaning towards Zombie for a while, but the more I thought about Robot, the more I was able to see a vision for it and I already have materials for the robot. If I chose Zombie, I would have to spend more time and money which is slim right now.
Loose wires and screws
Add LED strips to make the base pop
Acrylic laser cut base with aluminum foil
Need weights to hold the base down and not move too much
Instead of doll hair for the hall effect, it'll be wires.
Need to pick a robotic font to make to make the title and words for the sensors.
I want to make a robotic body with the score board in the center of the body. With that, I need to find a screen the is big enough to do so.
Should I sculpt the body with foam? A different material?
I need to find robotic sounds now for the game.
Bigger lights and buttons
Spray paint: black, silver and teal
Nuts, bolts, and gears of different sizes
Wires
Smack my Rusty Nuts
Deez Nuts and Bolts **
Switch Me Silly
Switch and Twitch Me
Get materials for the building part of the game
Have the Fusion 360 model of the robot body and game base be done before the weekend.
I was confused about how to connect the encoder to the leg where it is durable and not easily removable while playing. Ollie suggested getting certain measurements of the encoder and the insertion of the leg. With those measurements, they said to 3D print two halves of an enclosure to secure the two. I got the measurements and now in the works of modeling it in Fusion.
James had the chance to play with the game through a breadboard. One thing he pointed out is that it wasn't very obvious when he was able to start repeating the sequence. So potentially have some type of indicator that the user can start repeating the sequences.
He also mentioned how important the sounds will be within the game to help make the game more interactive.
Julian pointed out that players won't be able to play that long if each round the sequence changes. Suppose I want players to engage with it more, to have it like the Simon game where each round, with sequence, is the same but added by one.
Another point he mentioned is to only give players one life. It'll encourage them to want to play again. With that, the screen on the chest of the robot should just show two numbers. One with the current score and then one with the overall high score.
4/5 body parts are now on the box! How are they sticking to the box? LEGO!
I talked to my parents about how I was going to make the bases to hold the doll parts up because I didn't want to wait a long time to laser cut/3D print a base and then not have it be stable enough for the box. Since my stepdad has a hobby with Legos, they suggested using them. I didn't know about the idea right away but gave it a shot. It turned out to be possibly the best idea for the game.
My stepdad also suggested putting some resistors and other things with the wires that are meant to look like guts to give it a more aesthetic feeling.
Peter and Ollie both suggested to not use the copper tape for the hand pushing and instead have a pivot where the elbow is to the arm and have the base of the arm hit a button. Peter gave me two arcade buttons to use since they have a better recoil and feel to them.
I was working on the audio MP3 shield with Jawon to see how we can get it to work and we saw that it will work best with an Uno instead of a Mega since both boards have different output pins even though the pin numbers are the same. Plus, if I'm wanting to use a screen to show a score for the player, all of that would be too much for the Mega. So Jawon suggested using the Mega or the screen and sensors while the audio shield will be with the Uno.
With this ^ that means the code is not 99% done anymore and the schematic is also going to change.
With Peter's button suggestion and with the help of leftover mega blocks, lego pieces, and my stepdad, we created a platform for the butt to be able to be pressed down and hit the button.
With Peter's button again and Ollie's design suggestion, we drilled a whole through the arm of the doll and used the lego peices to hold it into place. Some body parts needed to lift with the top of the box, so we super glued the arms pivot to the lid of the box and had the button stay inside of the box.
Peter suggested having a covering for the encoder that will help have a tight fit to the leg and the encoder. So I 3D printed a small cover for the leg and the encoder and my first iteration didn't go so well for it is now inside of the leg, so I reprinted the core and added a base to it so it can't go through the leg anymore. I then worked with my stepdad to make a base to hold the encoder and leg together where it'll be able to spin properly. The spinning doesn't feel the greatest. It feels a bit loose and wobbly, so I might look into possibly adding weight to the leg itself.
This component is the least durable for the magnet is only being held by 4 loose wires at the moment. I'm not sure if hot glue will hold it together, I do have super glue, but I want to make sure it looks exactly how I want it to look before gluing it. Just like the arm, the guts will be attached to the top of the lid while the sensor will stay in place in the box.
The holes to the eyes are through the lid and the sensors are also in place of those holes, now I just need to put the eyes on top of those holes. I shaved a part of the paint on the eyes and then put clear nail polish hoping the sensors could get enough light. I'm not too worried about them being closed (receiving no light) since the Lego stands are covering the sides of the photo cells.
As mentioned before, the MP3 shield will work best on Uno instead of Mega. Jawon and I were able to test if the sound files would play through the speaker with the micro SD card. Since the test was successful, that means the card is formatted correctly and we can now use the sensors to trigger a sound. This will be the next obstacle to tackle.
We got the screen to turn on and say "Hello World" but it is not filling up the whole screen. Jawon and I can not figure out why is behaving the way it is.
If the screen doesn't work out as planned to show the player's score and the High Score of the game, might have to change the use to the screen by inserting an SD card and display the game's name. It wouldn't make sense to have a robot with a screen and nothing shows.
I printed both the Robot head and body. I spray painted both, but the body is still drying. They both fit each other well and serve their purpose for the game.
Printed a different body for changing screens to the game.
LED strip sequence shown through the robot's mouth.
Had to change screens from the TFT SPI to a regular LCD screen because the TFT screen was only showing up on the corner of the screen. It was not going across the whole surface. Jawon and I couldn't figure out why it was doing that and since there was not a lot of time time, I changed to the LCD screen.
I had help from Ash Duy from the Beach Robot team how to use the LCD screen with a MEGA. After some trouble shooting, I was able to have the screen turn on, show "Hello World!", and have numbers count.
Got the screen to show the High Score, current score, and tell the user when to watch the sequence and then repeat the sequence.
Had to extend the wires for the start button, and LED strip to reach the board and leave extra room for when I needed to open the box. The game is now done besides the sound effects for the game. The sound effects are not as important for the game but would make the game more enjoyable.