Skip to content

feat: Add multi-sensor reaction game example. #415

@nedseb

Description

@nedseb

What

Create a reaction game that randomly asks the player to perform different actions using various sensors and the D-PAD, then measures response time.

Why

Fun way to combine multiple STeaMi drivers in a single interactive example. Teaches event-driven programming and sensor polling.

Suggested approach

  1. The OLED displays a random command:
    • "TILT LEFT" → check ISM330DL accelerometer X axis
    • "PRESS UP" → check MCP23009E D-PAD
    • "COVER SENSOR" → check APDS9960 ambient light drops below threshold
    • "BLOW" → check HTS221 humidity spike
  2. Start a timer with ticks_ms()
  3. Wait for the correct sensor to trigger (with a 5-second timeout)
  4. Display reaction time on the OLED + play a success/fail buzzer sound
  5. After 10 rounds, show the average reaction time as the final score

Hardware

  • SSD1327 OLED + buzzer
  • ISM330DL, MCP23009E (D-PAD), APDS9960, HTS221

Documentation

Write a pedagogical activity sheet for the STeaMi wiki covering:

  • Learning objectives (sensors, polling, timing, game design)
  • Step-by-step instructions for students
  • Expected behavior and scoring
  • Extension ideas (add more actions, difficulty levels, multiplayer via BLE)

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions