Skip to content

Repository files navigation

🔧 Ardu-Stim Pattern Generator

Stop manually typing hundreds of array values. Build trigger wheel patterns visually, export C++ code instantly.

🚀 Try it live →


The Problem

Creating custom trigger wheel patterns for Ardu-Stim means writing arrays like this:

const unsigned char pattern[] PROGMEM = {
  1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,
  1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0
};

Nobody wants to count 72+ segments by hand or debug why their pattern is off by one tooth.

The Solution

Visual pattern builder that generates perfect C++ code every time:

  • 🎯 Click to edit - Select wheel segments and toggle signals with mouse clicks
  • 👀 See what you're building - Real-time wheel view + oscilloscope waveform preview
  • Smart tools - Quick presets for common patterns (36-1, 60-2) and bulk operations
  • 📦 Export ready - Copy-paste C++ arrays straight into your wheel_defs.h
  • 🔧 Multi-signal support - Crank + Cam1 + Cam2 patterns with proper bitwise encoding

Key Features

Interactive Wheel Builder

  • Visual wheel with 4-720 configurable segments
  • Selection-based editing (click segments, apply changes)
  • Multi-select with Ctrl+Click and Shift+Click for ranges
  • Color-coded signal visualization with gradient blending

Pattern Configuration

  • Quick presets: 36-1 Crank (72 segments), 60-2 Crank (120 segments)
  • Pattern tools: Clear All, Fill All, Invert Pattern
  • Real-time validation and statistics
  • Smart segment controls for common signal combinations

Live Preview System

  • Synchronized wheel and oscilloscope visualizations
  • Instant updates as you edit patterns
  • Separate color-coded waveforms for Crank/Cam1/Cam2 signals
  • Export scope view as PNG for documentation

Code Generation

  • Properly formatted C++ PROGMEM arrays
  • Includes pattern metadata and comments
  • One-click copy to clipboard
  • 100% compatible with Ardu-Stim wheel_defs.h format

Getting Started

Option 1: Use Online (Recommended) Just visit feb027.github.io/pattern-gen - no installation needed!

Option 2: Run Locally

git clone https://github.com/feb027/pattern-gen.git
cd pattern-gen
npm install
npm run dev

How It Works

  1. Configure your pattern - Set name, segment count, and choose a preset or start from scratch
  2. Edit visually - Click wheel segments to select them, then use controls to set signal states
  3. Preview in real-time - Watch both wheel and scope views update as you build your pattern
  4. Export code - Copy the generated C++ array and paste it into your project

Example: Creating a 36-1 Pattern

  1. Click "36-1 Crank (72 seg)" preset
  2. Pattern automatically loads with proper tooth spacing
  3. Scope shows realistic crank signal waveform
  4. Code output generates a complete PROGMEM array
  5. Copy and use in your Ardu-Stim project

Technical Architecture

Built with modern web technologies for performance and maintainability:

  • SvelteKit - Reactive framework with excellent developer experience
  • HTML5 Canvas - Native graphics for smooth wheel and scope visualizations
  • Tailwind CSS - Utility-first styling for rapid UI development
  • Svelte Stores - Centralized state management with reactive updates
  • Vite - Lightning-fast development and optimized production builds

Key Design Principles:

  • State-driven reactive UI
  • Modular component architecture
  • Pure functions for pattern logic
  • Zero external graphics dependencies

Project Status

Phase 1-3 Complete - Core functionality fully implemented:

  • Interactive wheel builder with multi-signal support
  • Real-time pattern configuration and validation
  • Live visualization system (wheel + scope views)
  • C++ code generation and export

🚧 Phase 4-5 Planned - Advanced features:

  • Image-to-pattern conversion from oscilloscope screenshots
  • Enhanced pattern import/export capabilities
  • Additional preset patterns for common engines

Contributing

This project has a clear scope and architecture. Contributions welcome for:

  • Bug fixes and performance improvements
  • Additional common engine patterns as presets
  • UI/UX enhancements
  • Test coverage expansion

See memory/ folder for detailed architecture and implementation docs.

Built For

🏎️ DIY automotive enthusiasts using standalone ECUs
🔧 Engine tuners and mechanics needing custom simulation patterns
💻 Speeduino/Ardu-Stim developers building trigger wheel definitions


Try it now: feb027.github.io/pattern-gen

This tool generates Ardu-Stim compatible code but is not officially affiliated with the Ardu-Stim project.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages