{"id":17967619,"url":"https://github.com/simonprickett/rustpitrafficlights","last_synced_at":"2026-04-28T01:33:17.975Z","repository":{"id":44146209,"uuid":"425336583","full_name":"simonprickett/rustpitrafficlights","owner":"simonprickett","description":"Raspberry Pi Traffic Lights Demo with Rust.","archived":false,"fork":false,"pushed_at":"2022-02-11T19:51:22.000Z","size":9,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-10T08:40:54.931Z","etag":null,"topics":["gpio","low-voltage-labs","raspberry-pi","rust"],"latest_commit_sha":null,"homepage":"https://simonprickett.dev","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonprickett.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-06T20:00:23.000Z","updated_at":"2024-07-14T12:15:16.000Z","dependencies_parsed_at":"2022-07-20T16:20:10.392Z","dependency_job_id":null,"html_url":"https://github.com/simonprickett/rustpitrafficlights","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simonprickett/rustpitrafficlights","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonprickett%2Frustpitrafficlights","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonprickett%2Frustpitrafficlights/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonprickett%2Frustpitrafficlights/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonprickett%2Frustpitrafficlights/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonprickett","download_url":"https://codeload.github.com/simonprickett/rustpitrafficlights/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonprickett%2Frustpitrafficlights/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32362781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"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":["gpio","low-voltage-labs","raspberry-pi","rust"],"created_at":"2024-10-29T14:09:10.365Z","updated_at":"2026-04-28T01:33:17.961Z","avatar_url":"https://github.com/simonprickett.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Experiments with Low Voltage Labs Traffic Lights on Raspberry Pi with Rust\n\nLet's look at how to control the Raspberry Pi's GPIO pins using the Rust programming language, and the [Low Voltage Labs traffic light LEDs](https://lowvoltagelabs.com/products/pi-traffic/).\n\nFor a complete description of how this code works, and a shopping list of things you'll need to make it run on a Raspberry Pi, check out the article on my website... TODO LINK TO FULL ARTICLE\n\nWe'll also use the [`rust_gpiozero` crate](https://crates.io/crates/rust_gpiozero) to control the state of the GPIO pins.\n\n## Attaching the Traffic Lights\n\nAttach the traffic lights so that they are connected to GPIO 9, 10, 11 ([Broadcom/BCM pin numbering](https://pinout.xyz/)).\n\n## Install Rust\n\nInstalling Rust also installs [Cargo](https://doc.rust-lang.org/book/ch01-03-hello-cargo.html), a build system and package manager for Rust projects.\n\nFollow the installation process [here](https://www.rust-lang.org/tools/install), which at the time of writing looks like this:\n\n```bash\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\n## Clone, Compile and Run the Code\n\nFirst, clone this repository:\n\n```bash\n$ git clone https://github.com/simonprickett/rustpitrafficlights.git\n```\n\nThen `cd` into the `rustpitrafficlights` folder and run the code:\n\n```bash\n$ cd rustpitrafficlights\n$ cargo run\n```\n\nIf all is well and the traffic lights are connected correctly, they should start to display the UK traffic light sequence (red, red \u0026 yellow, green, yellow, red).  Exit the program by pressing `Ctrl+C`.\n\nIf you don't see any lights, make sure that your traffic lights are connected to the expected GPIO pins.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonprickett%2Frustpitrafficlights","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonprickett%2Frustpitrafficlights","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonprickett%2Frustpitrafficlights/lists"}