How to Make a Game by Using a Microcontroller - Part 2
In the second installment of the "Let's Make a Game Using a Microcontroller!" series, we will create Tetris using the RL78/G23 Fast Prototyping Board (FPB).
If you haven't yet prepared your development environment, please refer to the Start Developing with RL78 - Essential for Microcomputer Beginners! (Part 1) blog for guidance.
Hardware Design
I will introduce the components used in the hardware design.
· RL78/G23 FPB
· Micro USB Type-B
· 5 x 7 blue dot matrix LED (MOA20UB019GJ) × 3
· Tactile switch × 4
· Resistors 1kΩ × 4, 390Ω × 21
· Capacitor 0.33μF
· Source type transistor array (M54564P)
· Sink type transistor array (TD62083APG) × 3
· Universal board for Arduino (AE-ARDUINO_UNI-G) × 2
· Pin socket (FHU-1x42SG)
· Pin header (PH-1x40SG)
I have implemented the following circuit on a universal board.
Here is the completed hardware.
Using a universal board compatible with Arduino UNO is recommended. The board comes with an Arduino UNO connector, making wiring a breeze. I was able to create beautifully finished hardware.
Software Design
I used a code generation tool called Smart Configurator to set up the initial configuration for each peripheral function. By simply selecting the desired features, you can easily generate the code.
Here are the steps to use the Smart Configurator.
1. Click on the "Smart Configurator (Design Tool)" link indicated by the red box in the image below to launch the Smart Configurator.
2. Select the tabs indicated by the red frame in the image below to make the initial settings for the clock, peripheral functions, etc.
3. Once you have finished configuring the settings, click on "Generate Code" to generate the code.
The Smart Configurator not only supports the initial setting but also generates the necessary functions for using those peripheral functions. For example, when using the Interval Timer feature of the Timer Array Unit, you can start the timer simply by calling the generated functions.
Once the code generation is complete, let's create the Tetris program. I created the Tetris program with reference to the YouTube video from Gamedokan, a game development channel.
Supplement
By modifying the number in the image below, you can adjust the speed at which the Tetris blocks fall.
- +1 Like
- Add to Favorites
Recommend
- A Renesas Success Story in Vehicle Control Applications with RL78/F1x MCU Series
- Renesas Introduces Low-Power RL78/G15 MCU with the Smallest 8-pin Package Option Available within the RL78 Family
- First Security Solutions for Renesas Automotive 16-bit MCU RL78 Make its Debut
- Renesas Announced 16-bit RL78/G24 MCU Delivers Top-Class Performance for Motor Control and Power Supply Control Systems
- RL78/G15 MCU, a New Release of the Renesas RL78 Family Products,Solves the Existing Issues Faced by Many 8-bit Users
- Renesas‘ MCU RL78/G23 achieves world‘s highest EEMBC ULPMark™-PP score!
- Renesas Smallest 16MHz Touch Microcontroller RL78/G16 for 8-Bit MCU Market
- Release of 12V Motor Control Renesas Solution Starter Kit for RL78/F24
This document is provided by Sekorm Platform for VIP exclusive service. The copyright is owned by Sekorm. Without authorization, any medias, websites or individual are not allowed to reprint. When authorizing the reprint, the link of www.sekorm.com must be indicated.