{"id":32846829,"url":"https://github.com/christo/fractal","last_synced_at":"2026-05-16T15:36:30.168Z","repository":{"id":320370447,"uuid":"1081814378","full_name":"christo/fractal","owner":"christo","description":"Fractal generator for Raspberry Pi with TFT touchscreen interface","archived":false,"fork":false,"pushed_at":"2025-11-02T23:33:20.000Z","size":92,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-03T01:13:24.861Z","etag":null,"topics":["fractal","mandelbrot","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/christo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-23T10:24:43.000Z","updated_at":"2025-11-02T23:33:24.000Z","dependencies_parsed_at":"2025-10-23T13:22:59.323Z","dependency_job_id":"231aa388-0005-4d2b-bde3-eb3752f9d121","html_url":"https://github.com/christo/fractal","commit_stats":null,"previous_names":["christo/fractal"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/christo/fractal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christo%2Ffractal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christo%2Ffractal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christo%2Ffractal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christo%2Ffractal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christo","download_url":"https://codeload.github.com/christo/fractal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christo%2Ffractal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33108232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fractal","mandelbrot","raspberry-pi"],"created_at":"2025-11-08T08:00:59.240Z","updated_at":"2026-05-16T15:36:30.145Z","avatar_url":"https://github.com/christo.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mandelbrot Set Generator for Raspberry Pi\n\nThis project generates Mandelbrot set images on Raspberry Pi with direct framebuffer access,\ndesigned for small TFT displays running without X11.\n\n## Setup Instructions\n\n### 1. Install Dependencies\n\n``` bash\nsudo make install-deps\n```\n\nOr manually:\n\n``` bash\nsudo apt-get update\nsudo apt-get install build-essential\n```\n\n### 2. Compile\n\n``` bash\nmake\n```\n\n### 3. Run\n\n``` bash\nmake run\n```\n\nOr directly:\n\n``` bash\n./mandelbrot\n```\n\n## Features\n\n- Works without X11 desktop environment\n- Uses direct framebuffer access for TFT displays\n- Defaults to `/dev/fb1` (TFT display), can target `/dev/fb0` (HDMI) with `-d` flag\n- Supports 16-bit (RGB565), 24-bit (RGB), and 32-bit (RGBA/BGRA) pixel formats\n- Multi-threaded rendering (4 worker threads) for optimal performance on multi-core Raspberry Pi\n- Performance varies by Pi model and screen resolution (Pi 3b was plenty quick\nfor a TFT of 320x240)\n\n## Usage\n\n```bash\n./mandelbrot                       # Run on TFT display /dev/fb1\n./mandelbrot -d /dev/fb0           # Run on HDMI display\n./mandelbrot -t /dev/input/event0  # specify touch device\n./mandelbrot --help                # Show usage information\n```\n\n## TODO\n\n- [x] add visual indicator of touchscreen centre\n- [x] derive WIDTH and HEIGHT from framebuffer\n- [x] fix origin bias of touch zoom (probably need offset bias in complex plane\nfor centre)\n- [x] use GPIO buttons for zoom out\n- [x] use GPIO buttons for reset zoom\n- [x] concurrency for 4-core rpi (4 render threads + touch/button handlers)\n- [x] test button 4 for electrical continuity (GPIO 18, pin 12)\n- [ ] touchscreen swipe to pan\n\n## Controls\n\n- Press Ctrl+C to exit\n- zoom controls using touchscreen\n\n## Configuration\n\nYou can modify these constants in the source code:\n\n- `SCALING`: Zoom level (smaller = more zoomed in)\n- `X_OFFSET`, `Y_OFFSET`: Center point of the view\n- `WIDTH`, `HEIGHT`: Output resolution\n- `MAXI`: Maximum iterations (higher = more detail, slower) numbers over 100\nprobably make no visible difference except on very high density displays\n- `COLOUR_SCALE`: Color cycling speed\n\n## Troubleshooting\n\nFor permission issues with framebuffer consider the following.\n\n``` bash\nsudo usermod -a -G video $USER\n```\n(Then log out and back in)\n\n## Autostart on Boot\n\nTo run the Mandelbrot generator automatically when the Raspberry Pi boots:\n\n### Install the systemd service\n\n**Option 1: Using Makefile (easiest)**\n\n```bash\n# From development machine\nmake remote-install-service\n\n# Or directly on the Pi\nsudo make install-service\nsudo systemctl start mandelbrot\n```\n\n**Option 2: Manual installation**\n\n```bash\nsudo cp mandelbrot.service /etc/systemd/system/\nsudo systemctl daemon-reload\nsudo systemctl enable mandelbrot\nsudo systemctl start mandelbrot\n```\n\n### Managing the service\n\n```bash\n# Check status\nsudo systemctl status mandelbrot\n\n# View logs in real-time\njournalctl -u mandelbrot -f\n\n# Stop the service\nsudo systemctl stop mandelbrot\n\n# Disable autostart\nsudo systemctl disable mandelbrot\n\n# Restart the service\nsudo systemctl restart mandelbrot\n```\n\n### Uninstall the service\n\n```bash\n# From development machine\nmake remote-uninstall-service\n\n# Or directly on the Pi\nsudo make uninstall-service\n```\n\n**Note:** The service uses `launch.sh` which ensures only one instance runs at a time. Manual launches while the service is running will safely exit without starting a duplicate process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristo%2Ffractal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristo%2Ffractal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristo%2Ffractal/lists"}