Latest Stable — v1.0.0

Download Micro PinOS

Everything you need to build production-quality pinball machines on microcontroller hardware.

Core Packages
🧠

Mega 2560 Sketch

Game-brain firmware only — MainMega.ino, all GameStyle headers, attract mode, and command vocabulary.

v1.0.0~52 KB.zip
⬇ Mega Sketch
// The main loop — four calls, every pass
void loop() {
  readRS485();         // S<id>:<state>\n frames
  processNextEvent();  // circular queue → dispatch
  updateGameLogic();   // state machine + timers
  updateSolenoids();   // millis() pulse manager
}

// GameStyle interface — five functions
struct GameStyle {
  const char *name;
  void (*onInit)();
  void (*onBallReset)();
  void (*onShot)(int sw);
  void (*onTimerTick)();
  void (*onBallDrain)();
};
📡

Nano Universal Sketch

Switch-node firmware — nano_universal.ino with switch_ids.h. All three node types in one file.

v1.0.0~18 KB.zip
⬇ Nano Sketch
// Configure at top — nothing else to edit
#define MY_ADDRESS  0   // 0–4
#define DE_PIN      2   // MAX485 DE

// One row per switch:
// pin | id | solPin | holdPin | pulseMs | debounceMs
static const SwEntry SW[] = {
  { 3, SW_SLINGSHOT_LEFT,  5, -1, 25, 5 },
  { 4, SW_SLINGSHOT_RIGHT, 6, -1, 25, 5 },
  { 7, SW_POP_BUMPER_TOP,  8, -1, 20, 5 },
};
// ── nothing below needs editing ──

// Handles: debounce, solenoid fire,
// dual-wound flipper hold/release,
// mode switching from Mega
Additional Assets
📐

Wiring Diagrams

Fritzing schematics for RS485 bus, MOSFET solenoid drivers, dual PSU wiring, and Nano-to-Mega bus topology.

PDFFritzing~3.2 MB
⬇ Wiring Diagrams
🎮

GameStyle Starter Pack

Four complete GameStyle templates — Classic Lanes, Multiball Madness, Progressive Jackpot, Timed Challenge.

.h headers~12 KB
⬇ GameStyle Pack
// Each style implements the same 5 functions:
void g1Init();              // game start
void g1BallReset();         // per-ball reset
void g1Shot(int sw);        // shot dispatch
void g1TimerTick();         // mode timers
void g1BallDrain();         // bonus count + cleanup

// GameStyleOne — Traditional
//   FIRE lanes → bonus mult (up to 5×)
//   Drop target bank → 5,000 + reset
//   Bumper frenzy after 75 hits (30s)
//   5 ramps → extra ball lit

// GameStyleTwo — Multiball Madness (stub)
// GameStyleThree — Progressive Jackpot (stub)
// GameStyleFour — Timed Challenge (stub)
🔬

Diagnostic Sketches

Bus monitor, solenoid test harness, switch event logger, and EEPROM inspector. Essential for hardware debugging.

.ino sketches~9 KB
⬇ Diagnostics
System Requirements

🧠 Controllers

  • ATmega2560 (Mega 2560)
  • ATmega328P Nano × 1–5
  • MAX485 module per board
  • 120Ω termination resistors

⚡ Power & Drive

  • 5V logic + 24–48V solenoid PSU
  • IRLZ44N or TIP120 per coil
  • 1N4007 flyback diode per coil
  • Common ground between PSUs

💻 Development

  • Arduino IDE 2.x or PlatformIO
  • USB A–B cable (Mega)
  • USB Mini-B cable (Nano)
  • RS485 4-wire bus (A, B, GND, +5V)

📡 Communication

  • RS485 bus at 115200 baud
  • Serial1 → RS485 / Nano bus
  • Serial2 → Sound board
  • Serial3 → Display / Lights

Open Source on GitHub

Star the repo, report issues, or contribute your own GameStyles and hardware configs.

Stars
Forks
MITLicense
🐙 View on GitHub
Changelog
v1.0.0 — Initial Release
  • FEAT RS485 multi-drop bus supporting up to 5 Nano nodes at 115200 baud
  • FEAT Universal Nano sketch — Type 1/2/3 in one file, configured by table
  • FEAT GameStyle plugin system — 4 selectable modes, 5-function interface
  • FEAT Attract mode with flipper-driven wheel selector and auto-cycle
  • FEAT Full command vocabulary: SOUND, LIGHT, VIDEO, SCORE, SOLENOID, MODE
  • FEAT Type 2 Nano local solenoid fire — no bus roundtrip, ultra-low latency
  • FEAT Type 3 dual-wound flipper coil — power kick + hold winding management
  • FEAT GameStyleOne: FIRE lanes, drop bank, bumper frenzy, ramp counter
  • IMP Circular event queue (32 deep) between RS485 reader and dispatcher
  • IMP EEPROM high-score persistence on Mega