{"id":17967645,"url":"https://github.com/simonprickett/pi-arcade-button-led","last_synced_at":"2026-04-29T17:33:16.219Z","repository":{"id":149219417,"uuid":"259140916","full_name":"simonprickett/pi-arcade-button-led","owner":"simonprickett","description":"Demo using an Adafruit Arcade button with built in LED as both an input and output with Python for Raspberry Pi.","archived":false,"fork":false,"pushed_at":"2020-05-09T15:24:43.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T09:29:41.298Z","etag":null,"topics":["adafruit","arcade-button","iot","led","piezo-buzzer","python","raspberry-pi","raspberrypi"],"latest_commit_sha":null,"homepage":"https://simonprickett.dev/raspberry-pi-arcade-button-led-game/","language":"Python","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-26T21:52:10.000Z","updated_at":"2021-11-12T18:42:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"49cf13d1-6b4f-4869-b6ba-a620eb2bd468","html_url":"https://github.com/simonprickett/pi-arcade-button-led","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonprickett%2Fpi-arcade-button-led","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonprickett%2Fpi-arcade-button-led/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonprickett%2Fpi-arcade-button-led/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonprickett%2Fpi-arcade-button-led/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonprickett","download_url":"https://codeload.github.com/simonprickett/pi-arcade-button-led/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247081837,"owners_count":20880507,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["adafruit","arcade-button","iot","led","piezo-buzzer","python","raspberry-pi","raspberrypi"],"created_at":"2024-10-29T14:09:13.454Z","updated_at":"2026-04-29T17:33:11.200Z","avatar_url":"https://github.com/simonprickett.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raspberry Pi Arcade Button LED / Buzzer Demos\n\nThis repository contains some example code for building a Raspberry Pi project using an Adafruit LED Arcade button, a Raspberry Pi and optionally a buzzer.\n\n## Shopping List\n\nI used the following:\n\n* [Adafruit Mini LED Arcade Button - 24mm Translucent Blue](https://www.adafruit.com/product/3432) (note the red and green versions of these won't work with the Pi as they need 5v, other colors are ok).\n* Raspberry Pi 3 (but any model should do, I just had a 3 on hand).\n* Piezo style buzzer, [got mine from Amazon](https://www.amazon.com/gp/product/B0727RGJLY/).\n* Food container, the sort that you get fresh soup in.\n\n## LED Button Counter Demo\n\nThe first demo I build uses the arcade button and its built in LED.  Whenever the button is pressed, a global variable is incremented and the LED flashes that many times.  The code for this is in `pi_arcade_button_led.py`.  This demo doesn't use the buzzer.\n\nClick to watch a video demonstration and code walkthrough:\n\n[![Video Thumbnail](https://img.youtube.com/vi/olSWVYz0dvE/0.jpg)](https://www.youtube.com/watch?v=olSWVYz0dvE)\n\n## LED Button Counter Demo with Buzzer\n\nThis demo is exactly the same as the above, but the buzzer also sounds every time the LED turns on.  Code is in `pi_arcade_button_led_buzzer.py`.\n\n## LED Button / Buzzer Game\n\nThis demo works a bit differently.  Again, every time the button is pressed, the LED will flash and a global counter is incremented.  This time, after a random number of button presses (1-5 in the demo), the buzzer will sound.\n\nImagine this as a game where the person that triggers the buzzer loses or has to do a forfeit, or maybe it's like a pass the parcel game where the person that triggers the buzzer is a winner!\n\nAfter the buzzer has been triggered, a new random number is chosen and the game immediately restarts.\n\nThe code for this example is in `pi_arcade_button_led_buzzer_game.py`.\n\nClick to watch a video demonstration and code walkthrough:\n\n[![Video Thumbnail](https://img.youtube.com/vi/oazOvfxgGPw/0.jpg)](https://www.youtube.com/watch?v=oazOvfxgGPw)\n\n## Running as a Service\n\nAs the Pi is stuck in a food container, and I can't access the ports etc, I can't login at the console.  I don't really want to have to SSH into the Pi to start the Python code either, so I made it start at boot by creating a systemd service file for it.\n\nThis file is `arcade_button_led.service`.  You can change which of the example code files it runs by altering the line:\n\n```\nExecStart=/usr/bin/python pi_arcade_button_led.py\n```\n\nYou may also need to update this line depending on where you cloned this repo to on your Pi:\n\n```\nWorkingDirectory=/home/pi/pi-arcade-button-led\n```\n\nI wrote a blog post on how to set up a systemd service on the Pi, the blog uses a Node.js application as an example but the same steps apply to setting up this Python code.  If you'd like to learn about how to do that, you can [read about it here](https://simonprickett.dev/writing-a-systemd-service-in-node-js-pi/).\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonprickett%2Fpi-arcade-button-led","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonprickett%2Fpi-arcade-button-led","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonprickett%2Fpi-arcade-button-led/lists"}