Game is created by Gerardo Barbarov Rostan and is an open-source project, so the code is constantly improving.
This time I present you a compact version of this game so that the track is linear and contains only 60 LEDs. The advantage of this design is that the device is portable and everything is put into operation in a few seconds.
The device is very simple and easy to make and consist of only a few components:
- Arduino Nano microcontroller
- WS2812 Led strip with 60 LEDs
- 2 buttons
- and two resistors
In the basic game mode, where the speed of the car is proportional to the pulsations of the control button, and in the ascent, ramps must be pressed more quickly to compensate for the effect of simulated gravity. One car is presented in RED and the other in GREEN. In the beginning, each car is represented by two LEDs, and each complete turn is increased by one led. An interesting effect is an inertia. After we stop pressing the button, the car continues to move for some time. The speed of movement of the cars as a function of the frequency of pressing the button can be easily adjusted in the code. Other interesting effects are the addition of sound that simulates the engine and the simulation of the ascent on the road. Effects are activated by holding down both keys while the device is turned on. At the end of the race, the first few LEDs glow with the color of the winning car.
Finally, the assembly is installed in a suitable box made of PVC material and coated with a self-adhesive label.