Add 100% authentic CMatrix implementation for Raspberry Pi 5#1
Open
bobster316 wants to merge 4 commits intomainfrom
Open
Add 100% authentic CMatrix implementation for Raspberry Pi 5#1bobster316 wants to merge 4 commits intomainfrom
bobster316 wants to merge 4 commits intomainfrom
Conversation
This commit adds a complete, algorithm-accurate replication of the original cmatrix terminal screensaver, ported for ST7789V3 240x280 displays on Raspberry Pi 5. Key features: - 100% accurate implementation matching original cmatrix C code - All character sets: ASCII (movie-accurate), Katakana, Console mode - All visual modes: Bold (none/even/all), 8 colors, rainbow mode - Original scrolling algorithms: new-style and old-style with head markers - Special effects: Lambda mode, character randomization (8%), speed control (0-10) - Movie-accurate preset matching "The Matrix" film appearance New files: - cmatrix_authentic.py: Core implementation with complete feature parity - CMATRIX_AUTHENTIC.md: Comprehensive documentation with algorithm details - test_cmatrix.py: Full test suite with 10 test scenarios - examples/: 5 example scripts demonstrating different modes - simple_matrix.py: Movie-accurate mode - rainbow_matrix.py: Rainbow colors with character randomization - katakana_matrix.py: Traditional Japanese characters - lambda_matrix.py: Lambda mode for programmers - interactive_matrix.py: Runtime control demonstration Updated files: - display.py: Now uses CMatrixDisplay instead of legacy MatrixDisplay - README.md: Updated with CMatrix documentation and usage examples Technical implementation: - Exact column algorithm with head markers and length tracking - Authentic character selection and randomization - Original bold detection (even-valued characters) - All 8 color schemes plus rainbow mode - Speed control matching original napms(update * 10) timing - Both synchronous and asynchronous column scrolling Based on: https://github.com/abishekvashok/cmatrix Original author: Chris Allegretta Current maintainer: Abishek V Ashok
Added three installation resources to make setup on Raspberry Pi 5 easy: 1. QUICKSTART.md - 5-minute quick start guide - Essential commands only - Perfect for getting started fast 2. INSTALL_GUIDE.md - Complete step-by-step installation instructions - Hardware wiring reference - Comprehensive troubleshooting section - Auto-start configuration - Performance tuning tips 3. quick_install.sh - Automated installation script - Checks SPI status - Installs all dependencies - Clones LCD driver if needed - Updates paths in all scripts - Tests display connection - Makes scripts executable Users can now simply: 1. Clone the repo 2. Enable SPI 3. Run ./quick_install.sh 4. Run python3 examples/simple_matrix.py The installer handles everything automatically.
This reorganization ensures existing working files remain untouched while providing clear separation between original and new implementations. Key Changes: ============ SAFE TESTING APPROACH: - Restored original display.py (user's working version - UNTOUCHED) - Created display_cmatrix.py (new version with authentic CMatrix) - Users can test standalone examples without affecting their working setup FILE ORGANIZATION: Renamed with clear prefixes to avoid confusion: - cmatrix_examples/ (was examples/) - cmatrix_test.py (was test_cmatrix.py) - cmatrix_install.sh (was quick_install.sh) - CMATRIX_DOCS.md (was CMATRIX_AUTHENTIC.md) - CMATRIX_INSTALL.md (was INSTALL_GUIDE.md) ARCHIVE: - Created _archive/ folder - Moved old/legacy files (matrix.py, install.sh, etc.) - Preserved for reference but not actively used NEW DOCUMENTATION: - TESTING_GUIDE.md - Comprehensive safe testing and integration guide - Phase 1: Test standalone (no integration) - Phase 2: Test integrated version (optional) - Phase 3: Permanent integration (optional) - Rollback instructions UPDATED ALL REFERENCES: - Updated all file paths in scripts - Updated all documentation references - Added safety warnings to README - Clear indication of original vs new files Final Structure: =============== display.py ✅ Original working version (preserved) display_cmatrix.py 🆕 New version with authentic CMatrix cmatrix_authentic.py 🆕 Core implementation cmatrix_examples/ 🆕 Standalone examples (test first!) cmatrix_test.py 🆕 Test suite cmatrix_install.sh 🆕 Installer TESTING_GUIDE.md 🆕 Safe testing instructions _archive/ 📦 Old files User Benefits: ============= 1. Existing working display is completely safe 2. Can test new matrix without any risk 3. Clear separation between original and new code 4. Easy rollback if needed 5. Optional integration only after successful testing This allows users to: - Keep their current setup running - Test the authentic CMatrix separately - Integrate only when ready - Rollback instantly if issues occur
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit adds a complete, algorithm-accurate replication of the original cmatrix terminal screensaver, ported for ST7789V3 240x280 displays on Raspberry Pi 5.
Key features:
New files:
Updated files:
Technical implementation:
Based on: https://github.com/abishekvashok/cmatrix
Original author: Chris Allegretta
Current maintainer: Abishek V Ashok