MULTI
- 10 Devlogs
- 23 Total hours
Arduino Multi tasking game
Arduino Multi tasking game
Posting this devlog right before ship. The news things i have done is i scrapped the flight minigame entirely, I have reworked the reaction time mingame that plays on the upper part of the lcd. The minigame now has more variety and it is now random when the time window to press the middle button appears and random how long it lasts. (another cat picture since i have nothing else to show a picture of)
HELLO PEOPLE, as i promised about 3 hours ago (sleep is something you can do after you have shipped) I have ported my Arduino project into web, it is now fully functional and you can try it. before you try here are the controls: 1 = leftbutton 2 = rightbutton Up = right You press the middle button when there is an x showing on the lcd screen Down = left When the left led is lit up point the potentiometer at it, and when the right led is lit up turn the potentiometer to face that. (no cat photo since i have something to show off) (btw flight is not yet implemented) (btw btw flight to start and restart the Arduino press the square and green button in the up right corner, in order to properly reset it you have to stop the simulation not pause it) As for the coding i have done i am still rewriting the up and down feature. LINK:https://app.cirkitdesigner.com/project/d06255aa-6f98-41b6-9677-e4eba724c674
Decided that i am going to be rewriting all the code involving the up down minigame, i will also be changing this project from hardware to software soon so in hopes of getting an ISS message in time before they sell out or the time expires. Due to me changing it from hardware to software not very much will change other than me providing a working build each devlog after this one that YOU can play by using an Arduino emulator link. I will also keep updating my GitHub when major changes are done. . (since nothing changed on the breadboard layout and nothing will change anytime in the future i will be placing a cat photo of one my cats in its place) (this photo is of Jupiter)
This is the biggest change i have made so far, the new things in the game are as follows: the 2 new buttons serve a purpose, new minigame where it says up, down, down then up or up then down, this minigame uses the 2 new buttons, added a new start menu where it prompts you to right button for multi and left button for a new minigame that will only be using the LCD screen, i changed the led color from green to red, and the last major change is that i made is removing useless old code. , My planned changes are making a new minigame using the lcd as the main part, and looking into if i can get the lcd backlight to work.
Removed every bug i encountered in about 10 minutes of playtime. Removed the “good action” led because i see it as unnecessary when more minigames are added, removed unneeded parts of the code and rewrote some of it to make it less confusing. I also made and coded in 2 new buttons to be used in the future. the possibilities you have when 3 side by side buttons are available is endless. I also made the parts that decide how little time you have in the reaction time game random so that they vary from half a second to 2/3 of a second per character. Means that your time window to react will fluctuate between 1.5 and 1 second. I also made the time it takes to fail the turn minigame vary from 3-2 seconds. , my vision for the 2 new buttons so far is that they will be clicked when a prompt shows up on the bottom part of the lcd (for example left, right or a combination of the 2) might even remove the old reaction time minigame entirely and replace it with something that uses all 3 buttons. (look at picture for current breadboard layout) (i wont post code due to there being very minor changes) (open picture in its own tab to view it fully)
Now i have finalized the 2 main multitasking games, one of them has an LCD screen that displays an time window of 1.5 seconds. in that timeframe you have to click a button to reset the timer to 8 seconds. so for 1.5 out of those 8 seconds you have to click the button. The other feature that i made is an potentiometer that grabs a random direction (left or right) and you have 3 seconds to turn the potentiometer to the correct side. you can see the correct side by looking at the 2 leds close to it (you can guess what sides they are on). The features i intent to add now are a second minigame on the screen (utilizing the lower part of the screen and 1 or more buttons) as for what i am going to do with that minigame in terms of functionality i have not yet decided. (picture has to be opened in its own tab for it to properly show)
The main feature that i will use for my Multitasking game is complete, the LCD screen that displays if you loose and that has a reaction time feature and an LED that lights green once you have completed a correct action. the game revolves around you having to click an button within a 3 second timeframe, if you fail to do then the entire Arduino freezes and the LCD displays a message about how you lost and that you must restart your Arduino to reset the minigame. The way that i am making this work is by using lots of integers. an example from the code is this: int lcdx = 0; if (digitalRead(switchPin) == HIGH){ if(lcdx >=14 && lcdx <= 16){ good++; lcd.clear(); digitalWrite(goodled, HIGH); delay(1000); digitalWrite(goodled, LOW); lcdx = 0; } This is how i register if the button was pressed within the timeframe, if it was pressed within the timeframe the “goodled” lights up and the minigame pauses for a second. My insiration for this project is the multitasking deivces you have to use to get your ppl (private pilots lisence) (picture is a pilot Multitasking test device)
I wanted to learn how an tilt sensor works and how to practically apply it to code since i was thinking about using it for my multitasking game. when i coded up the tilt sensor based digital hourglass i discovered that the tilt sensor legs are way to short to fit properly into the socket. after discovering this i thought i would still post a develog since i spent about an hours doing this. i would say that i generally advanced my coding knowledge with this
just Learned the second thing needed for this project, i learned how to make a buzzer and subsequently use buttons to turn it into an keyboard instrument of sorts. here is the code: int notes[] = {262, 294, 330, 349};void setup(){ Serial.begin(9600);}void loop(){ int keyVal = analogRead(A0); Serial.println(keyVal); if (keyVal == 1023){ tone(8, notes[0]); } else if(keyVal >= 990 && keyVal <=1010){ tone(8, notes[1]); } else if (keyVal >=505 && keyVal <= 1010){ tone(8, notes[2]); } else if (keyVal >= 5 && keyVal <= 10){ tone(8, notes[3]); } else { noTone(8); }} image is still wrongly cropped, to see the whole creation open the image in its own tab
The first of the many Arduino skills i will have to learn. I now understand how to control an potentiometer and an servo motor. The things that i still have to learn are: How to control an lcd, how to control an tilt sensor, how to make it so that your lcd has a high score and timer on it and much more. Here is the code i am using to controll the servo via potentiometer #include <Servo.h>Servo myServo;int const potPin = A0;int potVal;int angle;void setup(){ myServo.attach(9); Serial.begin(9600);}void loop(){ potVal = analogRead(potPin); Serial.print(“potVal: “); Serial.print(potVal); angle = map(potVal, 0, 1023, 0, 179); myServo.write(angle); delay(15);} image is getting cropped incorectly