Arduino uno random maze game
- random maze generator base on maze alghorithm
- two kind of bonuces
- ⭐ - need to pick up them all to unlock an exit
- ♥️ - increate a step count by 3
- exit when all ⭐ are collect
- ⛄ (step count) - limit of steps


The Analog Map() Vector Calculus
A thumb-joystick doesn't output "Tilt Left." It outputs a massive integer block, perfectly resting at 512 when your thumb is off, and slamming down to 0 or rocketing up to 1023 when pushed entirely.
- The Uno executes an aggressively tight Analog Read loop on
A0 (X Axis)andA1 (Y Axis). - The Physics Conversion Trap: You cannot just write
servoX.write(1023). A servo only understands0to180degrees. If you write1023, the servo will spin infinitely against its physical stop and violently strip its own plastic gears, melting its internal coil! - The
Map()Math:
int joyX = analogRead(A0);
int servoAngleX = map(joyX, 0, 1023, 10, 170); // Converts ranges! Caps the absolute limits!
servoX.write(servoAngleX); // Safely blasts the hardware!
Creating Complex Mechanical Dampening
If the Map() function is completely linear, moving your thumb exactly 1 millimeter causes the massive wooden table to jerk 5 degrees instantly, catapulting the steel ball bearing off the maze into your face.
- To create a beautiful, physical mechanical "Dampening" or "Smoothing" effect without buying expensive hardware gear-reductions, the programmer can utilize array-based software filtering.
- By utilizing a Moving Average Array, the C++ code effectively slows down the chaotic thumb inputs. It mathematically averages the last 10 joystick reads, causing the servos to "Breathe" and gracefully tilt the heavy table, completely eliminating terrifying mechanical jitter!
Mechatronic Pivot Equipment
- Arduino Uno/Nano (Standard functionality).
- Two Sub-Micro SG90 Servos (Although heavy-duty MG90S metal gears are preferred to literally lift the heavy weight of the wooden labyrinth boards).
- Dual-Axis Analog Joystick Module (KY-023).
- Physical cardboard, balsa wood, or a custom 3D printed Labyrinth maze setup mounted on a universal mathematical pivot joint.
using
- U8G2 library for SH1107 I2C display 128X128
- 2 position xy joystic
- buzzer