Skip to content

DanielHou315/DiceMaster

Repository files navigation

๐ŸŽฒ DiceMaster

A Programmable Multi-Screen Dice for Interactive Learning

License: MIT ROS2: Humble Platform: Raspberry Pi Alpha Release

Features โ€ข How It Works โ€ข Getting Started โ€ข Documentation โ€ข Contributing


๐ŸŒŸ About

DiceMaster is a revolutionary educational device that combines physical interaction with digital learning. Built with six high-resolution screens embedded in a dice form factor, it creates engaging, hands-free learning experiences through motion-based interaction.

Originally designed for language learning, DiceMaster detects shaking, rotation, and orientation to trigger dynamic content changes across all screens. Students can learn vocabulary, grammar, and more through interactive flashcards, quizzes, and gamesโ€”all without touching a single button.

๐ŸŽฏ Presented at SeriousPlay 2025

DiceMaster was showcased at the SeriousPlay 2025 conference, demonstrating its potential for game-based learning and pedagogical innovation. Stay tuned for research findings and student feedback!


โœจ Features

๐Ÿ–ฅ๏ธ Six 480ร—480 Displays

  • ESP32-powered screens with full-color JPEG support
  • Animated GIF playback capability
  • Multi-language text rendering (Arabic, Chinese, Cyrillic, Devanagari, and more)
  • Dynamic orientation-aware content display

๐Ÿง  Motion-Aware Intelligence

  • IMU-based motion detection (MPU6050 6-axis sensor)
  • Shake detection with configurable sensitivity
  • Automatic orientation detection (which side is facing up/down)
  • Screen rotation compensation for optimal readability

๐ŸŽฎ Programmable Game System

  • ROS2-based architecture for flexible game development
  • Create custom games with simple Python classes
  • Asset-based design: JSON text files, images, and animated GIFs
  • Hot-swappable games without system restart

๐Ÿ”Œ Robust Communication

  • Custom SPI protocol with CAN-bus-like addressing
  • Chunked image transmission for large media files
  • Priority-based message queue for responsive UI
  • DMA-optimized data transfer for performance

๐Ÿ› ๏ธ Developer-Friendly

  • Comprehensive Python API built on ROS2
  • Extensive documentation for beginners and maintainers
  • Example games and strategies included
  • Modular architecture for easy extension

๐Ÿ”ง How It Works

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Raspberry Pi Central                     โ”‚
โ”‚                                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ”‚
โ”‚  โ”‚   Game   โ”‚โ”€โ”€โ”€โ–ถโ”‚  Chassis  โ”‚โ—€โ”€โ”€โ”€โ”‚  IMU Sensor  โ”‚        โ”‚
โ”‚  โ”‚ Strategy โ”‚    โ”‚  Manager  โ”‚    โ”‚  (Motion)    โ”‚        โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜        โ”‚
โ”‚       โ”‚                โ”‚                                     โ”‚
โ”‚       โ”‚ Screen Commandsโ”‚                                     โ”‚
โ”‚       โ–ผ                โ–ผ                                     โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                  โ”‚
โ”‚  โ”‚   Screen Bus Managers (SPI)          โ”‚                  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ–ผ          โ–ผ          โ–ผ
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚ ESP32  โ”‚ โ”‚ ESP32  โ”‚ โ”‚ ESP32  โ”‚
  โ”‚ Screen โ”‚ โ”‚ Screen โ”‚ โ”‚ Screen โ”‚
  โ”‚  1 & 2 โ”‚ โ”‚  3 & 4 โ”‚ โ”‚  5 & 6 โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The Magic Behind DiceMaster:

  1. Sensors Detect Motion: IMU tracks shaking, rotation, and orientation
  2. Games React: Your Python strategy responds to sensor events
  3. Content Updates: Text, images, or GIFs are sent to specific screens
  4. Screens Display: ESP32 modules render content with proper rotation
  5. Learning Happens: Students interact naturally through physical manipulation

๐Ÿš€ Getting Started

๐Ÿ“š For Game Creators

Want to create your first educational game? Check out our comprehensive guide:

๐Ÿ‘‰ Beginner's Game Development Guide

Learn how to:

  • Create a "Hello Dice" game in 30 minutes
  • Use text, images, and animated GIFs
  • Respond to shaking and rotation
  • Build interactive quizzes and flashcards

Quick Example

from dicemaster_central.games.strategy import BaseStrategy
from dicemaster_central_msgs.msg import MotionDetection

class MyGame(BaseStrategy):
    _strategy_name = "my_game"

    def start_strategy(self):
        # Subscribe to shake detection
        self.create_subscription(
            MotionDetection, '/imu/motion',
            self.on_shake, 10
        )
        # Display content on all screens
        self.display_greeting()

    def on_shake(self, msg):
        if msg.shaking:
            # Change content when shaken!
            self.display_next_question()

๐Ÿ“– Documentation

๐Ÿ“˜ Comprehensive Guides

Guide Description Audience
Beginner's Guide Step-by-step tutorial for creating your first game Game Developers
Developer Guide In-depth system architecture and maintenance System Developers
CLAUDE.md Quick reference for AI-assisted development All Developers
Protocol Specification Complete SPI communication protocol Hardware/Firmware Developers
Hardware Guide Assembly and hardware configuration Hardware Engineers
Software Setup Installation and deployment instructions DevOps/Administrators

๐Ÿ—‚๏ธ Repository Structure

DiceMaster/
โ”œโ”€โ”€ DiceMaster_Central/           # Raspberry Pi ROS2 codebase
โ”‚   โ”œโ”€โ”€ dicemaster_central/       # Main Python package
โ”‚   โ”‚   โ”œโ”€โ”€ games/                # Game system core
โ”‚   โ”‚   โ”œโ”€โ”€ hw/                   # Hardware interfaces (SPI, I2C, IMU)
โ”‚   โ”‚   โ”œโ”€โ”€ managers/             # Game manager and lifecycle
โ”‚   โ”‚   โ””โ”€โ”€ media_typing/         # Protocol implementation
โ”‚   โ”œโ”€โ”€ examples/                 # Example games and strategies
โ”‚   โ”‚   โ”œโ”€โ”€ games/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ chinese_quizlet/  # Language learning example
โ”‚   โ”‚   โ””โ”€โ”€ strategies/
โ”‚   โ”‚       โ””โ”€โ”€ shake_quizlet/    # Motion-based quiz strategy
โ”‚   โ””โ”€โ”€ launch/                   # ROS2 launch files
โ”œโ”€โ”€ DiceMaster_ESPScreen/         # ESP32 Arduino firmware
โ”œโ”€โ”€ DiceMaster_ROS_workspace/     # ROS2 build workspace
โ””โ”€โ”€ docs/                         # Documentation

๐Ÿ› ๏ธ Building Your Own DiceMaster

๐Ÿ—๏ธ Hardware Requirements

  • Raspberry Pi 4 (or Compute Module 4)
  • 6ร— ESP32-S3 boards with 480ร—480 IPS displays
  • MPU6050 6-axis IMU sensor
  • Custom 3D-printed dice enclosure
  • Power supply and wiring harness

๐Ÿ“ฆ Software Stack

  • ROS2 Humble (built from source for Raspberry Pi)
  • Python 3.10+ with custom packages
  • Arduino IDE for ESP32 firmware
  • Custom py-spidev library (8KB buffer support)

๐Ÿ”จ Build Instructions

Full assembly and build instructions coming soon!

We're finalizing documentation for:

  • 3D printing the enclosure
  • PCB assembly and wiring
  • Raspberry Pi configuration
  • ESP32 firmware flashing
  • Complete system integration

Want to be notified? Star this repo and watch for updates! โญ


๐ŸŽฎ Example Games

Chinese Quizlet

A language learning game that displays vocabulary questions with image hints. Shake to cycle through questions!

  • Top Screen: Question text ("What is this in Chinese?")
  • Bottom Screen: Answer (e.g., "็Œซ" - cat)
  • Side Screens: Four hint images
  • Interaction: Shake to change question

Pipeline Test

A diagnostic tool that cycles through all screens with test messages.

  • Verifies all screens are working
  • Tests SPI communication
  • Demonstrates screen addressing

๐Ÿค Contributing

We welcome contributions from the community! Whether you're building new games, improving documentation, or enhancing the core system, your help is appreciated.

Ways to Contribute

  • ๐ŸŽฎ Create Games: Share your educational game strategies
  • ๐Ÿ“ Improve Docs: Help make our guides clearer
  • ๐Ÿ› Report Issues: Found a bug? Let us know
  • ๐Ÿ’ก Suggest Features: Have ideas? We're listening
  • ๐Ÿ”ง Submit PRs: Code contributions welcome

Development Setup

# Clone with submodules
git clone --recursive https://github.com/DanielHou315/DiceMaster.git

# Build ROS2 workspace
cd DiceMaster/DiceMaster_ROS_workspace
source prepare.sh
colcon build --symlink-install

# Run tests
cd ../DiceMaster_Central/dicemaster_central
python3 -m pytest tests/

๐Ÿ™ Acknowledgments

Contributors

DiceMaster Team - University of Michigan Shapiro Design Lab

  • Lead Developer: Daniel Hou

Built With

DiceMaster stands on the shoulders of amazing open-source projects:

Core Technologies

Hardware Interfaces

  • py-spidev - Python SPI interface (custom build)
  • smbus2 - Pure Python I2C library

ESP32 Development

Python Ecosystem

Special Thanks

  • U-M Shapiro Design Lab for supporting this research project
  • SeriousPlay 2025 conference for providing a platform to share our work
  • The ROS2 community for incredible tools and support
  • All educators who provided feedback during alpha testing

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

You are free to use, modify, and distribute DiceMaster for educational and commercial purposes.


๐Ÿ“ฌ Contact & Support


Made with โค๏ธ by the Shapiro Design Lab at the University of Michigan

Empowering education through interactive technology

โฌ† Back to Top

About

DiceMaster repo for both modules

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors