Maker.io main logo

Mini Cyclone Game on WS2812 LED Ring and Arduino Nano

2023-05-12 | By Mirko Pavleski

License: General Public License Arduino

This game is based on the Cyclone arcade game, where the player tries to stop an LED scrolling around a circle at a specific spot.

 

In one of my previous videos(https://youtu.be/1K0vr-hrh0k), I presented you the same game, but on a large ring consisting of 60 LEDs, which contained several levels.

pic1

This time I used a small ring with 12 LEDs and the game does not contain levels but is a continuous game until the target marker is missed.

pic2

In addition, there is an LCD display that shows high score and current round.

The code was taken from Joern Weise's GitHub page (https://github.com/M3taKn1ght/Blog-Repo/tree/master/Cyclone), and I made some modifications.

First, I shortened the way of testing the LEDs, and then added different sounds for each segment of the game so that it is now much more interesting.

The device is very simple to build and consists of only a few components:

  • Arduino nano microcontroller
  • 12 LEDs ring with WS2812 Led chip
  • 16x2 LCD display with I2C communication protocol
  • two buttons
  • and Buzzer

 

pic4

If you want to make a PCB for this project, or for any other electronic project, PCBway (www.pcbway.com) is a great choice for you. PCBway is one of the most experienced PCB manufacturing company in China in field of PCB prototype and fabrication. They provide completed PCB assembly service with worldwide free shipping , and ISO9001 quality control system. Also, on their site there is an online gerber viewer where you can upload your gerber and drill files to render your board.p11

As for the gameplay, as I mentioned before, in this case there are no levels with increasing speed, but each successive round starts with a randomized speed, and generally the speeds can be easily changed in the code in the lines:

#define STARTINTERVAL 250 //"Normal" move

#define MAXINTERVAL 500 //Very slow move

#define MININTERVAL 50 //Very fast move

pic5

Now let's see how the device works in reality. When turning on the game, all LEDs light up sequentially accompanied by an appropriate sound effect, and a corresponding message about the test on the LCD display.

pic5

Next, by pressing the button the game starts. The goal is to press the button at the moment when the rotating LED is located exactly on the static LEDs. In the first two levels, three LEDs are static, and in the next levels only one. The number of laps completed, and the score are shown on the display.

pic5

If we fail to hit the red Led, the game ends, and High Score appears on the display.

pic6

The number of laps completed, and the score are shown on the display. Otherwise, the high score is recorded in the eprom of the microcontroller so that it is saved even after the reset.

pic7

If we want to delete the high score, when turning on, we hold down the HSR button.  And finally, the game is mounted on a PVC board with a thickness of 3 mm and covered with self-adhesive colored wallpaper.

pic8

制造商零件编号 A000005
ARDUINO NANO ATMEGA328 EVAL BRD
Arduino
¥202.68
Details
制造商零件编号 1643
ADDRESS LED RING SERIAL RGB
Adafruit Industries LLC
¥63.19
Details
制造商零件编号 DFR0554
GRAVITY: I2C 16X2 ARDUINO LCD WI
DFRobot
¥96.86
Details
制造商零件编号 PK-11N40PQ
BUZZER PIEZO 5V 12MM TH
Mallory Sonalert Products Inc.
¥27.97
Details
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum