Complete skeeball control system with interactive Flask UI built in. All testing functionality from ui_simulator.py is now available as web pages.
skeeball_routes.py- Flask blueprint with all routes and API endpointslane_manager.py- Multi-lane coordinator (already completed)lane_controller.py- Per-lane wrapper (already completed)serial_bridge.py- Pi Pico communication layer (already completed)game_logic.py- Updated with lane_id support (already completed)
-
index.html- Main hub with links to all features -
simulator.html- Interactive testing UI (matches ui_simulator.py features)- Live game state display
- Manual control buttons (💰 Coin, ⊕ +10, ⊕ +50, 🏌️ Lane, 🎱 Ball)
- Roll outcome simulator (Miss, 10, 20, 30, 40, 50, 100 points)
- Event log with timestamps
- Real-time status refresh
-
control.html- Multi-lane control panel- Active lane display
- Current credits, score, balls
- Online/offline status
- Quick actions (coin, reset)
-
stats.html- Statistics dashboard- Total games played
- Best score per lane
- Average score
- Total coins inserted
- Live status updates
FLASK_INTEGRATION.md- Step-by-step integration guideMULTI_LANE_ARCHITECTURE.md- Scalable architecture overviewFLASK_READY.md- This file
cd /path/to/arcade-tracker
# Core Python modules
cp /home/jackiegreybard/Skeeball/game_logic.py .
cp /home/jackiegreybard/Skeeball/input_manager.py .
cp /home/jackiegreybard/Skeeball/lane_controller.py .
cp /home/jackiegreybard/Skeeball/lane_manager.py .
cp /home/jackiegreybard/Skeeball/serial_bridge.py .
cp /home/jackiegreybard/Skeeball/skeeball_routes.py .
cp /home/jackiegreybard/Skeeball/config.py .
# Templates
mkdir -p templates/skeeball
cp -r /home/jackiegreybard/Skeeball/templates/skeeball/* templates/skeeball/Add these lines to your app.py:
# At top with other imports
from skeeball_routes import register_skeeball_routes
# After app = Flask(__name__)
register_skeeball_routes(app)pip install pyserial>=3.5 gpiozero>=2.0- Main Hub:
http://localhost:5000/skeeball/ - Simulator:
http://localhost:5000/skeeball/simulator - Control:
http://localhost:5000/skeeball/control - Stats:
http://localhost:5000/skeeball/stats
Total setup time: ~8 minutes
✅ Live game state (credits, score, balls) ✅ Manual controls (coin, score_10, score_50, lane_track, ball_scored) ✅ Roll outcome buttons (Miss through 100 points) ✅ Event log with timestamps ✅ Auto-refresh every 500ms ✅ Reset button
✅ View all active lanes ✅ See current status of each lane ✅ Quick coin insert button ✅ Quick reset button ✅ Online/offline status ✅ Auto-refresh every 2 seconds
✅ Total games played per lane ✅ Best score per lane ✅ Average score ✅ Total coins inserted ✅ Real-time status
GET /skeeball/api/lanes - List all lanes
GET /skeeball/api/lanes/<id>/status - Get lane status
GET /skeeball/api/lanes/<id>/stats - Get lane statistics
POST /skeeball/api/lanes/<id>/trigger - Trigger event (testing)
POST /skeeball/api/lanes/<id>/reset - Reset lane
POST /skeeball/api/roll-outcome - Simulate roll outcome
POST /skeeball/api/simulator/insert-coin - Insert coin
POST /skeeball/api/simulator/score-10 - Score 10 points
POST /skeeball/api/simulator/score-50 - Score 50 points
POST /skeeball/api/simulator/lane-track - Lane track
POST /skeeball/api/simulator/ball-scored - Count ball
All routes require login (inherited from arcade-tracker)
Just navigate to /skeeball/simulator - no GPIO needed
from gpiozero import Device
from gpiozero.pins.mock import MockFactory
Device.pin_factory = MockFactory()
# Now run your app - GPIO calls use mocks# Insert coin
curl -X POST http://localhost:5000/skeeball/api/simulator/insert-coin \
-H "Content-Type: application/json" \
-d '{"lane_id": "lane_1"}'
# Score 100 (via roll outcome)
curl -X POST http://localhost:5000/skeeball/api/roll-outcome \
-H "Content-Type: application/json" \
-d '{"lane_id": "lane_1", "outcome": "100"}'- Pi 4 runs arcade-tracker with skeeball
- GPIO pins connected directly
lane_managerauto-initializes withlane_1
- Pi 4 runs arcade-tracker (lane_1 + coordinator)
- Pi Pico on USB (lane_2)
- Auto-discovery finds and registers lane_2
- Pi 4 runs coordinator only
- Multiple Pi Picos on USB
- All lanes auto-discovered and registered
arcade-tracker (Flask)
↓
skeeball_routes.py (Blueprints & API)
↓
lane_manager.py (Coordinator)
├── lane_controller.py (lane_1 - local GPIO)
├── lane_controller.py (lane_2 - serial)
└── lane_controller.py (lane_N - serial)
↓
game_logic.py (Game state per lane)
- ✅ Copy files to arcade-tracker
- ✅ Update app.py
- ✅ Run arcade-tracker
- ✅ Access
/skeeball/simulator - ✅ Test with UI
- ✅ (Later) Connect actual GPIO pins
- ✅ (Later) Add Pi Picos for additional lanes
- Check Flask is running
- Verify you're logged in
- Browser console for errors
- Check blueprint is registered in app.py
- Verify
/skeeball/prefix in routes
- On Pi 4: Check pin configuration
- On dev machine: Use MockFactory
- Check
input_manager.pyis working
/home/jackiegreybard/Skeeball/
├── game_logic.py ← Core game logic (lane_id ready)
├── input_manager.py ← GPIO handler
├── config.py ← Pin config
├── lane_controller.py ← Per-lane wrapper
├── lane_manager.py ← Multi-lane coordinator
├── serial_bridge.py ← Pi Pico communication
├── skeeball_routes.py ← Flask integration
├── pico_firmware.py ← Pi Pico MicroPython
├── templates/skeeball/
│ ├── index.html ← Main hub
│ ├── simulator.html ← Testing UI
│ ├── control.html ← Lane dashboard
│ └── stats.html ← Statistics
├── MULTI_LANE_ARCHITECTURE.md ← Design doc
├── FLASK_INTEGRATION.md ← Integration steps
└── FLASK_READY.md ← This file
✅ Single lane simulator ready ✅ Multi-lane architecture designed ✅ Flask UI complete with all testing features ✅ API endpoints implemented ✅ Ready for arcade-tracker integration ✅ Ready for GPIO hardware ✅ Ready for Pi Pico expansion
You're ready to integrate!