Recent improvements - March 2024 -
- Added better Graphics
- Added Kill counter
- Added attacking invaders
- Solved score bug
- Added HighScore saving to LitteFs
- Added Touch control (for what its worth)
- Added QR-code for APK download
Demonstrator
We're building a demonstrator for a fair based on Arduino-Pro boards.Choice is the Portenta C33 board, with a Renesas Cortex M33 Processor running upto 200Mhz (!). MCU is part of the RA6M5 series, and supports a stunning 512Kram and 2MB Flash. This should be enough to build a demo with fancy graphics, using the HAT expander board, making it look like a Raspi :)
Graphics LCD
So using the HAT expander gives us plenty of interfacing options : I2C, SPI, UART, Simple Parallel. The HAT / RPI can support a high speed parallel DPI66 interface, this is a bit too much for the CortexM33. So choice is for a 20Mhz SPI based LCD with a sub-HAT connector from Waveshare : 3.5inch RPi Display - LCD wiki
Space Invaders
Being a boomer and a commodore 64 user, I have a weak for the old games, and Space Invaders is one of them :), With the current MCU performance there are quite some possibilities - see my Doom Demo
Scrolling through the available Libraries on GitHub, there is a simple object oriented C++ for Arduino using a similar driver : YXHYX - GitHub
The code is very basic but effective to use : forked :)
Code
We use a AdaFruit GFX supporting driver, also available on Github. However its not supporting multi SPI (Portenta board supports 2 SPI interfaces), and SPI1 is on the HAT positions we like to use. The adapted driver can be found here :Waveshare_ILI9486-Portenta. The Space Invaders Code is adapted for some more fancy stuff:
- Add multi row enemies
- Add moving enemies, side bombing enemies
- Add multi-shoot option
- Add better Graphics
- Add exploding player and enemies
- Improve speed by using Block-SPI transfers
- Add BLE remote control + TouchScreen control
- Fix the scoring system - saving Haighscores to Filesystem
Using your phone as the remote is a fancy and simple solution.The C33 with ESP32 supports this feature, and the Android BLE library is free to use. The Renesas Controller is set to send out a BLE advertising, and using a simple Android app gives you the possibility to have a joystick controlling your Invaders Laser-gun by sending key-codes.App is build with MIT AI - https://ai2.appinventor.mit.edu/ code and graphs are available on my Github
Note: The Portenta C33 comes with a ESP32 WIFI/BL module supporting a tiny winy utterly very small micro uFL antenna connector. I was not able to fix the antenna firmly: it always comes off by the slightest movement, so I used an epoxy glue-drop to keep it on the connector.
Handy Links :- RGB 565 ColorPicker
- Image to C-Array converter
- IL9486 Datasheet
- Arduino Pro products
- MIT App Inventor - link
- RPOI 3.5" Wiki
Comments
Please log in or sign up to comment.