/Tonuino

Primary LanguageC++GNU General Public License v3.0GPL-3.0

DIY Musicbox

This is a complete rewrite of Thorsten Voß TonUINO project.

While building the project for myself and trying to integrate various additional features, I figured that the code required some refactoring. As usual with refactoring, you start at a small part and end up refactoring the whole thing ;)

Hence, I changed the original code from the usual C-style way of programming to a more C++-style. There is now an event loop with events for the different inputs (button presses, track finished, new RFID card, …) which than each call a handler that again calls a specific function on the currently active system mode.

All in all, I ended up removing most of the free standing functions and magic numbers spread throughout the whole code and replaced them with proper abstraction and/or polymorphism. I hope this makes the code more stream lined and easier to extend in the future.

While I tried to replicate all the existing features form the original project, I am not yet fully done. Some of the latest features (such as toddler mode, freeze dance, …) are not supported. These are things that I will work on in the near future. However, the basic features as for example reading the RFID card and playing the corresponding files is fully functional. See the below list for a complete overview about the finished features. I also added a couple of new features or changed how things worked.

Original features

  • Button interaction
    • 3 Button setup
    • 5 Button setup
  • Play folder
    • Album mode
    • Playbook mode (will save progress in EEPROM)
    • Repeat one mode
    • Party mode
    • Album mode (von - bis)
    • Playbook mode (von - bis)
  • RFID cards
    • Read RFID cards (same format as original code)
    • Write RFID cards (same format as original code)
  • Admin mode
    • Program new cards
    • min/max volume
    • Pin code
    • Admin card
    • Math question to unlock
    • Enter with key stroke
    • Say menu options
  • Settings
    • Min/Max volume
    • Last/initial volume
    • Equalizer
    • TonUINO is locked
    • Last active card/folder (this allows resuming the last playback after standby)
    • Audiobook progress
  • Additional system modes
    • Freeze Dance
    • Toddler
    • Kindergarten

Additional features

  • Lock and Unlock cards
  • Status LED
  • Battery control and automatic shutdown
  • Control via serial console (DEBUG_SERIAL)
  • Dump settings (DEBUG_SERIAL)
  • Dump RFID card (DEBUG_SERIAL)
  • Sleep mode during playback (playback will be paused after a defined time period)