Skip to content

OpenLedRace version with accelerator or button inputs, track animations and winner melody

License

Notifications You must be signed in to change notification settings

ArminJo/OpenledRace

Repository files navigation

Extended version of the OpenledRace version "Basic for PCB Rome Edition. 2 Player, without Boxes Track".

Open Led Race logo

Badge License: GPLv3     Badge Version     Badge Commits since latest     Badge Build Status     Badge Hit Counter

Also available as OpenLedRace example in the NeoPatterns library.

If you find this library useful, please give it a star.

🌎 Google Translate


If you find this program useful, please give it a star.

Extensions to standard version

  • Input from MPU6050 Accelerometer.
  • Classes for Car, Bridge, Ramp and Loop with natural gravity.
  • Light effects by NeoPattern library.
  • Tone generation without dropouts by use of hardware timer output.
  • 2004 LCD for instructions and leap counter.
  • Input feedback by an 8 pixel Neopixel bar.
  • Winner melody by PlayRTTTL library.
  • Compensation for blocked millis() timer during draw.
  • Checks for RAM availability.
  • Overlapping of cars is handled by using addPixelColor() for drawing.
  • Development mode, where Gravity, Friction and Drag can be set by potentiomenters.

Principle of operation

With every button press or every acceleration of the dumbbells you add a fixed amount of energy to the "car".
This energy is used to increase speed.

Formula is: NewSpeed = sqrt((OldSpeed * OldSpeed) + AdditionalEnergy)

On the other hand, energy is consumed by friction and drag.
Gravity also increases or decreases the car as in real life.

Formula is: NewSpeed = OldSpeed + Gravity + Friction + (OldSpeed * Drag)


Pictures

At the Hannover MakerFaire 2022 At the Cologne public library MINTköln-Festival 2021
Accelerometer version from MakerFaire 2022 OpenLedRace at the Cologne public library MINTköln-Festival

YouTube Videos

At the Hannover MakerFaire 2022 At the Cologne public library MINTköln-Festival 2021
OpenLedRace at the Hannover MakerFaire 2022 OpenLedRace in action

Compile with the Arduino IDE

Download and extract the repository. In the Arduino IDE open the sketch with File -> Open... and select the OpenledRace folder.
You need to install Adafruit NeoPixel library under "Tools -> Manage Libraries..." or "Ctrl+Shift+I" -> use "neoPixel" as filter string.
You also need to install NeoPatterns and PlayRtttl library under "Tools -> Manage Libraries..." or "Ctrl+Shift+I"

BOM

Required

  • Breadboard
  • Jumper wire
  • Pin header to connect cables to breadboard
  • Arduino Nano
  • WS2812 strip 5m 60 IP30 - 60 pixel per meter
  • 10 kOhm resistor for WS2812 strip data input
  • 2 Arcade pushuttons + 2x2 meter 2-wire cable
  • 2 Handlebar ends with foam grips to mount the pushuttons
  • 2004 LCD with serial I2C interface adapter
  • Speaker > 32 Ω
  • 4.7 µF capacitor for speaker
  • Power supply - e.g. a 18650 battery + holder

Recommended

  • 1k potentiometer for volume control
  • "Reset Game" Pushbutton for breadboard

Optional

  • 2 8xWS2812 bars + 2 10kOhm resistors for optical input feedback
  • 2 GY-521 MPU6050 accelerometer Breakout boards (+ 2 Blink LEDs)
  • 2x2 meter 4-Wire cable (+ 2x2 10 kOhm I2C pullup resistors) to connect the accelerometers
  • 2 Dumbbells, each 1 kg

For development

  • 3 100k potentiometers for setting of Gravity, Friction and Drag.

Pin layout is defined here

Breadboard overview Accelerometer connection
BreadboardOverview Accelerometer connection
Breadboard top view Breadboard front view
Breadboard top view Breadboard front view

Links:

About

OpenLedRace version with accelerator or button inputs, track animations and winner melody

Resources

License

Stars

Watchers

Forks