For full functionality of this website it is necessary to enable JavaScript in your browser!

Code on Github

About this game

  • MadLEDs is an observation game for the ESP32 board write in C++.
  • This game is simple, one of the three LEDs lights up and you "catch" it by pressing the corresponding button. If you make it before the other LED is illuminated so you will be added a point if not, so you have no point. The time delay between LED switching can be set at the beginning of the game after the opening animation.
  • With OLED display and battery status and with simple goal and that is: FUN :)

Components for building

  • Some ESP32 board
  • 0.96" 128x64 OLED display, I2C
  • Fuel Gauge MAX17048 battery sensor (this is not necessary, but is recommended). You can use any MAX1704x supported library listed in the library section, but you must modify the code before using it.
  • 6 buttons
  • 3 LEDs and resistors for LEDs(you have to calculate the value of the resistor...)
  • And many cables...

Libraries

Overview of the user environment

  • Home screen:

  • History screen:

  • Game progress screen:

  • Game end screen (this screen is followed by the home screen):

[1] - Battery percentage
[2] - Battery voltage
[3] - 4 is min value, 9 is max value, MIN is a variable in the following order (MIN, TAR, MAX, RES)
[4] - 100 is resolution(RES), 50 is target(TAR)
[5] - 0 is number of correct answers, 50 is maximum number of points(one correct = one point)
     - 4 is min value, 9 is max value, 100 is resolution
     - The last number after *_* is the user identification number
[6] - 0 is number of correct answers, 42 is number to finish, 50 is maximum number of points
[7] - 0 is number of correct answers, 50 is maximum number of points

Explanation of setting modes

The time delay between the change of the LED is randomly generated in the range from number MIN to number MAX, this number is then multiplied by the RES value and a time value in milliseconds is created which indicates the time delay of the LED. TAR is your target (maximum points).

Description of all buttons

On home screen

  • button1 - Switches between setting values for MIN,TAR, MAX, RES modes
  • button2 - Reduces the value by 1 for the currently selected mode
  • button3 - Increases the value by 1 for the currently selected mode
  • acceptButton - Start the game
  • scrollButton - Switches between Home screen and History screen
  • sleepButton - Puts the board into deep sleep or wakes it from deep sleep

On history screen

  • scrollButton - Switches between Home screen and History screen
  • sleepButton - Puts the board into deep sleep or wakes it from deep sleep

On game progress screen

  • button1 - When pressed, it "grabs" LED 1
  • button2 - When pressed, it "grabs" LED 2
  • button3 - When pressed, it "grabs" LED 3
  • acceptButton - Exit the game
  • sleepButton - Puts the board into deep sleep or wakes it from deep sleep

On game end screen

  • sleepButton - Puts the board into deep sleep or wakes it from deep sleep