{"id":28506719,"url":"https://github.com/tscholze/dotnet-iot-raspberrypi-rainbow","last_synced_at":"2026-04-20T10:04:35.862Z","repository":{"id":297824747,"uuid":"994896012","full_name":"tscholze/dotnet-iot-raspberrypi-rainbow","owner":"tscholze","description":"A C# .NET implementation for controlling the Pimoroni Rainbow HAT! multi sensor board on a Raspberry Pi.","archived":false,"fork":false,"pushed_at":"2026-04-07T14:57:52.000Z","size":633,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-07T15:29:55.678Z","etag":null,"topics":["apa102","bmp280","chsarp","dotnet","ht16k33","iot","linux-app","pimoroni","pimoroni-rainbowhat","raspberry-pi","sensors"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":false,"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/tscholze.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-06-02T16:42:40.000Z","updated_at":"2026-04-07T13:53:20.000Z","dependencies_parsed_at":"2025-06-07T18:38:20.559Z","dependency_job_id":null,"html_url":"https://github.com/tscholze/dotnet-iot-raspberrypi-rainbow","commit_stats":null,"previous_names":["tscholze/dotnet-iot-raspberrypi-rainbow"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tscholze/dotnet-iot-raspberrypi-rainbow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tscholze%2Fdotnet-iot-raspberrypi-rainbow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tscholze%2Fdotnet-iot-raspberrypi-rainbow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tscholze%2Fdotnet-iot-raspberrypi-rainbow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tscholze%2Fdotnet-iot-raspberrypi-rainbow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tscholze","download_url":"https://codeload.github.com/tscholze/dotnet-iot-raspberrypi-rainbow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tscholze%2Fdotnet-iot-raspberrypi-rainbow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32042295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["apa102","bmp280","chsarp","dotnet","ht16k33","iot","linux-app","pimoroni","pimoroni-rainbowhat","raspberry-pi","sensors"],"created_at":"2025-06-08T20:06:14.006Z","updated_at":"2026-04-20T10:04:35.857Z","avatar_url":"https://github.com/tscholze.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌈 Rainbow HAT for .NET IoT\n\nThis repository contains a comprehensive C# library for interacting with the [Pimoroni Rainbow HAT](https://shop.pimoroni.com/products/rainbow-hat-for-android-things) using .NET IoT. The Rainbow HAT is a beautiful add-on board for Raspberry Pi that includes various sensors and visual elements.\n\n\u003ccenter\u003e\n   \u003cimg src=\"_docs/image.png\" height=\"200\" alt=\"Image of the project\" /\u003e\n\u003c/center\u003e\n\n## 🎯 Features\n\nThe library provides easy-to-use controllers for all Rainbow HAT components:\n\n- **📊 Alphanumeric Display** - Four-digit display with scrolling text support\n- **💡 RGB LEDs** - Individual control of red, green, and blue status LEDs\n- **🎨 APA102 LED Strip** - Seven RGB LEDs with brightness control\n- **🌡️ BMP280 Sensor** - Temperature and pressure readings\n- **🔘 Touch Buttons** - Three capacitive touch buttons with event handling\n- **🔊 Buzzer** - PWM-controlled piezo buzzer\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Raspberry Pi 4\n- Pimoroni Rainbow HAT\n- .NET 10.0 SDK\n- Basic knowledge of C# and .NET\n\n### Installation\n\n1. Clone this repository:\n```bash\ngit clone https://github.com/yourusername/Rainbow.git\ncd Rainbow\n```\n\n2. Build the project:\n```bash\ndotnet build\n```\n\n3. Run the demo:\n```bash\ndotnet run\n```\n\n### Basic Usage\n\n```csharp\n// Display scrolling text\nusing var display = new SegmentDisplayController();\nawait display.DisplayScrollingText(\"Hello World!\");\n\n// Control RGB LEDs\nusing var lights = new LightController();\nlights.Red.TurnToState(Light.Target.On);\n\n// Read temperature\nusing var sensor = new Bmp280Controller();\nConsole.WriteLine($\"Temperature: {sensor.Temperature?.DegreesCelsius:F1}°C\");\n\n// Play a tone\nusing var buzzer = new BuzzerController();\nbuzzer.PlayNote(440, 1.0); // Play A4 for 1 second\n```\n\n## 📖 Documentation\n\nEach component has its own controller class with comprehensive XML documentation:\n\n- `SegmentDisplayController` - Manages the alphanumeric display\n- `LightController` - Controls individual RGB LEDs\n- `Apa102Controller` - Handles the APA102 LED strip\n- `Bmp280Controller` - Interfaces with the temperature/pressure sensor\n- `ButtonController` - Manages touch button events\n- `BuzzerController` - Controls the piezo buzzer\n\n## 🎮 Demo Application\n\nThe project includes a comprehensive demo in `Samples.cs` that showcases all features:\n\n```csharp\nawait Samples.FullTourAsync();\n```\n\n## 🖥️ Rainbow.Maui.Gtk — GUI Control Hub\n\nThe `Rainbow.Maui.Gtk` project provides a graphical control hub for the Rainbow HAT, built with [.NET MAUI on Linux via GTK4](https://github.com/Redth/Maui.Gtk). It runs directly on the Raspberry Pi and lets you interact with all hardware features through a desktop GUI.\n\n### Features\n\n- **💡 Status LEDs** — Toggle individual red, green, and blue LEDs or control all at once\n- **🎨 APA102 LED Strip** — Set solid colors, adjust brightness, or display a rainbow pattern\n- **🌡️ BMP280 Sensor** — Read live temperature and pressure data\n- **📊 Segment Display** — Show static or scrolling text on the 4-digit display\n- **🔊 Buzzer** — Play tones at configurable frequencies\n- **👆 Buttons** - Checks of one of the hardware buttons has been tapped\n\n### Prerequisites\n\n- All base prerequisites (Raspberry Pi, Rainbow HAT, .NET 10.0 SDK)\n- GTK 4 libraries installed on the Pi:\n  ```bash\n  # Debian / Ubuntu / Raspberry Pi OS\n  sudo apt install libgtk-4-dev\n  ```\n\n### Running the GUI\n\n```bash\ncd Rainbow.Maui.Gtk\ndotnet run\n```\n\n### Screenshot\n\nRunning on RaspberryOS and an attached small Raspberry Pi Display, the user interface looks like the following.\nThere is whith reason no customized control appereance.\n\n![GTK4 screenshot](https://github.com/tscholze/dotnet-iot-raspberrypi-rainbow/blob/main/_docs/gtk4.png?raw=true)\n\n## 🔧 Hardware Components\n\nThe Rainbow HAT includes:\n- HT16K33 LED Matrix Driver\n- BMP280 Temperature/Pressure Sensor\n- APA102 LED Strip\n- Piezo Buzzer\n- Three Capacitive Touch Buttons\n- Three RGB Status LEDs\n\n## 📜 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## 📁 Project Structure\n\n```\nRainbow.sln\n├── Rainbow/                     Console app \u0026 hardware library\n│   ├── Apa102/                  APA102 LED strip controller\n│   ├── Bmp280/                  BMP280 temperature/pressure sensor\n│   ├── Buttons/                 Capacitive touch buttons\n│   ├── Buzzer/                  Piezo buzzer controller\n│   ├── Lights/                  RGB status LED controller\n│   ├── SegmentDisplay/          4-digit alphanumeric display\n│   ├── Program.cs               Console demo entry point\n│   └── Samples.cs               Demo code\n└── Rainbow.Maui.Gtk/            MAUI GTK4 GUI control hub\n    ├── Program.cs               GtkMauiApplication entry point\n    ├── MauiProgram.cs           MAUI builder configuration\n    ├── App.cs                   MAUI Application class\n    └── MainPage.cs              Control hub page\n```\n\n## ❤️ More IoT projects of mine\nI like to tinker around with Raspberry Pis, I created a couple of educational apps and scripts regarding the Pi and sensors - mostly from Pimoroni.\n\n### .NET on Raspberry Pi \n- [dotnet-iot-raspberrypi-blinkt](https://github.com/tscholze/dotnet-iot-raspberrypi-blinkt) A C# .NET implementation for the Pimoroni Blinkt! LED board on a Raspberry Pi.\n- [dotnet-iot-raspberrypi-enviro](https://github.com/tscholze/dotnet-iot-raspberrypi-enviro) A C# .NET implementation for the Pimoroini Enviro HAT with BMP, TCS and more sensors\n- [dotnet-iot-raspberrypi-rainbow](https://github.com/tscholze/dotnet-iot-raspberrypi-rainbow) A C# .NET implementation for the Pimoroini Rainbow HAT with Lights, BMP, segment displays and more\n\n### Windows 10 IoT Core apps\n- [dotnet-iot-homebear-blinkt](https://github.com/tscholze/dotnet-iot-homebear-blinkt) Windows 10 IoT Core UWP app that works great with the Pimoroni Blinkt! LED Raspberry Pi HAT.\n- [dotnet-iot-homebear-tilt](https://github.com/tscholze/dotnet-iot-homebear-tilt) Windows 10 IoT Core UWP app that works great with the Pimoroni Pan and Tilt HAT (PIC16F1503)\n- [dotnet-iot-homebear-rainbow](https://github.com/tscholze/dotnet-iot-homebear-rainbow) Windows 10 IoT Core UWP app that works great with the Pimoroni RainbowHAT\n\n### Android Things apps\n- [java-android-things-firebase-pager](https://github.com/tscholze/java-android-things-firebase-pager) An Android Things app that displays a Firebase Cloud Messaging notification on a alphanumeric segment control (Rainbow HAT)\n- [java-android-things-tobot](https://github.com/tscholze/java-android-things-tobot) An Android Things an Google Assistant app to controll a Pimoroni STS vehicle by web and voice\n\n### Python scripts\n- [python-enviro-gdocs-logger](https://github.com/tscholze/python-enviro-gdocs-logger) Logs values like room temperature and more to a Google Docs Sheet with graphs\n- [python-enviro-excel-online-logger](https://github.com/tscholze/python-enviro-excel-online-logger) Logs values like room temperature and more to a M365 Excel Sheet with graphs\n- [python-enviro-azure-logger](https://github.com/tscholze/python-enviro-azure-logger) Logs values like room temperature and more to an Azure IoT Hub instance\n\n## 🙏 Acknowledgments\n\n- Pimoroni for the excellent Rainbow HAT hardware\n- .NET IoT team for the System.Device.Gpio library\n- IoT.Device.Bindings project for the BMP280 driver\n- [Platform.Maui.Linux.Gtk4](https://github.com/Redth/Maui.Gtk) for .NET MAUI on Linux via GTK4\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftscholze%2Fdotnet-iot-raspberrypi-rainbow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftscholze%2Fdotnet-iot-raspberrypi-rainbow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftscholze%2Fdotnet-iot-raspberrypi-rainbow/lists"}