Stop manually typing hundreds of array values. Build trigger wheel patterns visually, export C++ code instantly.
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.
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
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.hformat
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- Configure your pattern - Set name, segment count, and choose a preset or start from scratch
- Edit visually - Click wheel segments to select them, then use controls to set signal states
- Preview in real-time - Watch both wheel and scope views update as you build your pattern
- Export code - Copy the generated C++ array and paste it into your project
- Click "36-1 Crank (72 seg)" preset
- Pattern automatically loads with proper tooth spacing
- Scope shows realistic crank signal waveform
- Code output generates a complete PROGMEM array
- Copy and use in your Ardu-Stim project
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
✅ 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
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.
🏎️ 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.