Arduino Star Wars Game - how to make
HTML-код
- Опубликовано: 12 сен 2024
- Hello, in this tutorial we will make this little game console on breadboard, We will use 128x64 I2C oled display, arduino nano, three push buttons and buzzer. Our first game will bee star wars game.
SUBSCRIBE HERE:
/ @volosprojects
You can also buy me a coffe at:
ko-fi.com/volo...
Buy this OLED display here:
www.banggood.c...
To program this game you will need libraries , you can download libraries here : drive.google.c...
You will also need arduino sketch : drive.google.c...
If you like this project feel free to subscribe for more games and arduino project. Thank you!
#ArduinoCar #ArduinoProject
Thanks Volos Project. An entertaining and educational project. I got my non original Nano working on my Windows 11 laptop after updating my CH340 driver with CH341SER driver. Also of use was a gentleman's suggestion below (sorry cant recall who this was)' when using a 0.96 128x64 i2c OLED to :
You need to call constructor differently this case:
Thats how your code at lines around 26 should look like:
#define OLED_RESET 4
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
Thanks a billion
SIMPLE FIX FOR 128x64
replace and paste this below
#define OLED_RESET 4
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
Do you know if I can use a 240x240 inch TFT screen? If so, what would I have to modify to the code?
I ported this to an electronics board I developed that has joysticks and you go up and down using a joystick... Thank you!
Nice project! 👏👏 I did a TikTok video with your project for this may 4th. Saludos desde México!!
That’s so cool I already had an AliExpress tab open and I was bout to start looking for the display but the tab was already on the perfect one I needed
Si desean corregir el tamaño de la pantalla agreguen esto el número es en donde esta escrito
27 #define ANCHO_PANTALLA 128 // Ancho de la pantalla OLED
28 #define ALTO_PANTALLA 64 // Alto de la pantalla OLED
30 Adafruit_SSD1306 display(ANCHO_PANTALLA, ALTO_PANTALLA, &Wire, OLED_RESET);
THANKS
Se puede poner un pantalla de 240x240 pulgadas? Y si es así que tendría que cambiar, te agradecería si me ayudas
For those of you who have problems with the screen, you simply have to configure the pixel size in line 10 and 11 of the code.
hello, can i ask... the up and down buttons as well as the buzzer didnt work for me. do you know what could be the problem?
@@jam1930 check the pins of the buttons and the gnd
How can i configure?
@@fardintechltd7208 For those of you who have problems with the screen, you simply have to configure the pixel size in line 10 and 11 of the code.
trying my best but cant see the pixel size thing@@bysatoo
Hvala, sada mi neće biti dosadno
Nema na cemu 😃
Ja isto znam sa arduino, mada imam 13 godina, kako se zoves
Very nice!!! Can't wait for my display to arrive to try this out!!!
Hi there. I really like your projects! Great stuff!
I am currently having issues with getting this project's code working with my SSD1315 I2C OLED Display. Do you know what might I need to change in the code to get it working? Thanks!
Sorry i dont, i never used that display.
@@VolosProjects No worries, thanks for the reply anyway.
@@MaxImaginationdid You used it?
Can you play the game without it being plugged into computer?
The library support to 32 bit?
saludos de Colombia amigo muchas gracias por el juego
Is there a way to pair rc receiver to arduino transmitter, I want an rc receiver because of how compact and cheap it is and also the wide voltage range I can input to it
What a great Arduino projec, thaks for sharing! Did you write the sketch yourself?
Hello! Thank you! Yes i did, feel free to use or modify code :)
@@VolosProjects Thank you very much, I want to try and port it to ESP-WROOM-02, just for fun :)
@@VolosProjects I modified it for the ESP-WROOM-02 (esp8266), I hope you like it! ruclips.net/video/ryxZ4GuhdXc/видео.html
أين الكود code
the movement switches are connect with D11 and D12 and firing is at D3 and all ground are common i am right ??? pleasee tell
The google drive link expired. Can you give us the new one? :)
Did you find the libraries???
Hi, did you do something special to connect both buzzer and OLED screen ? I had issues about that with a nano (you got exactly the same setup). I heard about the choosen pin that can be the source of the problem.
Someone else talked about the buzzer that could not be a real buzzer, do you have some references ? ;)
Your projects are great !
Thank you, i didnt do anything special. But i remeber that i have that problems in past, i just used another pin on arduino. Dont forget setup that pin in code.
@@VolosProjects Thanks, I also get a freeze when I used both buzzer and OLED, I will check the pin 9 on the nano, it could be the problem solver 😉
Porque no me funcionan los botones si las conexiones son correctas?
Very good 👍
Awesome video but the code is for a 128x32 size display
Great little game. just have one question. What is " long readVcc " doing? during compilation it shows me error on every variable as not declared and game is working fine after removing that part from code. But maybe is needed for something? Thanks
Omg, i forgot to delete that part, if you power arduino with lipo baterry, that part will tell you voltage of battery, you can delete it, it is not needed for game
I was Wondering How you would go about Programming this code to be displayed on a TV screen though an RCA cable?
Please let me know!
Omg that would be so cool
You did?
Hey bro. I am new to arduino projects. can you tell if i still need to sketch the pixel display or you provided it on the description
Getting an error with this ... ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1); This is the error from the IDE ... 'ADMUX' was not declared in this scope. Also, one of the libraries, Adafruit_SSD1306_Wemos_OLED is not included in the sketch. Also, the code is very messy.
same problem
Hello, I loved your project. But I'm having a problem downloading the libraries, when I enter the link it always gives an error, could anyone help me?
How do you change size to fit screen
Size of what?
I can't see the full game on my oled display screen.Please help.
It did not work ?
Hey man, nice project. I have a question. Can this project be built on arduino UNO aswell?
Yes, Uno and nano use same MCU
@@VolosProjects Will the code need any changes though? Thanks for replying!
@@user-wn1hr6yx2f no
@@VolosProjects I have 1 more question. When i apload the code and try to verify it. There is an error thats says, low memory available. That means my arduino UNO does not have enough space for the code?
@@user-wn1hr6yx2f it is just warning, just upload code
Nice! Very good 👍
sound works but screen does not
I'm new to all of this but which Arduino is that?
@Unofficial Engineer thank you
Está bien hermoso... 😍
Cool video but the libraries link is broken, thanks
thanks bro its work!!!
Nice to hear that😃
can you use the TVOUT package in another tutorial to make the game on a mini CRT screen?
am using this for a project would anybody know to to change the display size as i am using this on a smaller screen?
Smaller than the one he’s already using??
Help I have make everything right and it’s work before and it’s not displaying now, I suspect maybe I uploaded too many times or the display die. If it’s the display how can I fix it.
Circuit diagram link please
is it possible to do with an esp32 and a st7789 display?
Can you share the code?
very good !
Hi, the file in Google Drives appears as not found, could you help me with the code?
Could adapt this to a 128x64 0.96" Display easily? Awesome video by the way!
this is 0.96 128x64 i2c OLED, maybe you have SPI veon with more pins?
@@VolosProjects This is what I have. www.ebay.com/itm/0-96-I2C-IIC-Serial-128X64-128-64-Blue-OLED-LCD-LED-Display-Module-for-Arduino/382850692423?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2649
I noticed in the code at the top it says its for a 128x32 size display using I2C
Here is a video of my issue. ruclips.net/video/p9GSG2C5qK0/видео.html
@@ForwardEngineering I had the same issue and I found the solution, looks like you're using new libraries from arduino repository with Volos's sketch.
You need to call constructor differently this case:
Thats how your code at lines around 26 should look like:
#define OLED_RESET 4
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
Will it work on nano uno or mega?
probably it will , i tried only on nano
sir, the game works fine but it does not fit to the screen size its enlarged and i can only see half of the picture, any solutions?
Your library is set to 128x32 so picture is sreched, you need to set it to 128x64
hello! it can not download
good morning bro i need this to work for 1.3 inch oled display.
can you please help me with the 0.96 "128x64 oled code.
why cant i upload my code to my arduino nano
i dont know, it can be many reasons
I got the hardware going but cant get it to fit the screen. Seems super zoomed in. Any thoughts?
hi mat, your library is set to 128x32, you need to set 128x64. Do you use library i posted in description?
@@VolosProjects I downloaded the library zip file but the ide is saying it doesn't contain a valid library. Can I change it manually?
Do you bave original adafruit library? Od you bave , you Will news to delte iz bacouse they Will ne on conflict
does this work with an lcd
Классно, всё работает. Но у меня экрас IIC OLED SSD 1306 и контроллер Arduino UNO 12 MHz. Работает медленнее и треть экрана игры не входит в дисплей (в нижней части)
i cant download libraries plz do solution
i Just amde this game with my children and love it. I have one problen i need to resize the screen. on my screen the bottom of the image is cut off like i need to shring the game display. is this posible?
Hello, now, you need to eneter setup file of library, i forgot name of that file and you need to chose correct size of your display
Did you find the libraries???
can't download library(
I like it
Hey plz do solution for libraries , i can't download 😢
Did you find the libraries???
Great job! But as an educational material, I opened your code and none of the variables made sense to me, so i didn't learn much by reading it. I wish they were in English so that everyone could understand.
What about copy paste the variables in Google translate or DeepL?
Then you search and replace all variables with the translated ones.
I have TFT LCD Display Module 1.3inch SPI 240x240 RGB ST7789 and I tried making this project but I didn t manage to make it because the code doesn t work for my display, I tried modifying it but the screen only flickers and I see only half of the star ship and its not playable at all. Can you pls help me with the code?
Lo pudiste solucionar?
For some unknown reason, Arduino people seem to hate provding a parts list in their video description 😑
ı am dont see score
It just said no such file or directory.
Hi there nice game , but after i uploaded the code the starship either goes up or down automatically , and idk how to fix this problem , any help?
I dont know, I havent tried game latley , you can try to check conection
can u use oled 128 x 64 ?
this is oled 128x64
@@VolosProjects but when i uploaded the script, the display is stretched. The ship does not appear on the oled
@@vel1800 your library is probably set to 128x32 you will need to find Adafruit_SSD1306.h file inside your library folder. You will need to edit it. Un comment 128x64 and comment 128x32
@@VolosProjects ohhhhh, thanks mann
@@vel1800 hi i got the same problem. I found the Adafruit_SSD1306.h file but how do u edit it?
buttons are not working
Probably you didn't connect a wire or mal connected it or an error in the code
the link didnt work
Did you find the libraries???
is this convertable to 3.5 tft lcd with uno?
Did You used it?
Do you know if there is a way to get this to work with the adafruit ssd1331 oled?
sorry, i never used 1331 , you can try
i tried and is not working
cool project,but the code is messy, please consider giving English names to the variables and add comment lines
Yes i know, that is old project. Sorry, now i am trying to make more redable code.
code please!!!!!
Can we use pro mini
Yes , it wil be even more compact
Can we use ESP8266?
Yes, it will run even better
Circuit diagram please
Can you pls send me the code of 0.96 oled display. It would great help
You can download it, it is in description
You can download it, it is in description
could someone help me
library code give me
Did you find the libraries???
volose brt pomagaj ovaj google drive link ti neradi vise
Did you find the libraries???