{"id":22509470,"url":"https://github.com/amid68/nrf52840_led_button_interrupt","last_synced_at":"2025-03-28T00:23:34.391Z","repository":{"id":265697100,"uuid":"896150428","full_name":"Amid68/nRF52840_LED_Button_Interrupt","owner":"Amid68","description":"A simple example demonstrating LED control via button input using interrupts on the nRF52840 Development Kit.","archived":false,"fork":false,"pushed_at":"2025-01-29T23:02:05.000Z","size":154,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T00:18:26.802Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Amid68.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}},"created_at":"2024-11-29T16:43:55.000Z","updated_at":"2025-01-29T23:02:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"983780ed-f1ca-4659-ac26-a72d9f0ad07a","html_url":"https://github.com/Amid68/nRF52840_LED_Button_Interrupt","commit_stats":null,"previous_names":["amid68/nrf52840_led_button_interrupt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amid68%2FnRF52840_LED_Button_Interrupt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amid68%2FnRF52840_LED_Button_Interrupt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amid68%2FnRF52840_LED_Button_Interrupt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amid68%2FnRF52840_LED_Button_Interrupt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Amid68","download_url":"https://codeload.github.com/Amid68/nRF52840_LED_Button_Interrupt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245945339,"owners_count":20698215,"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":[],"created_at":"2024-12-07T01:29:11.833Z","updated_at":"2025-03-28T00:23:34.341Z","avatar_url":"https://github.com/Amid68.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nRF52840 LED Button Interrupt Example\n\nThis project demonstrates how to control multiple LEDs using button interrupts on the nRF52840 Development Kit (DK). The example is implemented using the Zephyr RTOS, leveraging the DeviceTree for hardware abstraction. The buttons' states are monitored using interrupts, and the LEDs are toggled accordingly.\n\n---\n\n## **Prerequisites**\n\n- **Hardware**: Nordic Semiconductor nRF52840 DK\n- **Software**: \n  - Zephyr SDK\n  - Nordic Semiconductor nRF Connect SDK\n- A basic understanding of GPIO operations and Zephyr's DeviceTree.\n\n---\n\n## **Features**\n\n- Reads input from four buttons on the nRF52840 DK:\n  - **Button 1**: Toggles **LED 1**.\n  - **Button 2**: Toggles **LED 2**.\n  - **Button 3**: Toggles **LED 3**.\n  - **Button 4**: Toggles **LED 4**.\n- Implements an interrupt mechanism for efficient button press detection.\n- Modular code structure with separate files for buttons and LEDs.\n\n---\n\n## **Hardware Setup**\n\n### **Button and LED Mapping**\nThe code uses the following mappings:\n- **Button 1** (`sw0`): Toggles **LED 1** (`led0`).\n- **Button 2** (`sw1`): Toggles **LED 2** (`led1`).\n- **Button 3** (`sw2`): Toggles **LED 3** (`led2`).\n- **Button 4** (`sw3`): Toggles **LED 4** (`led3`).\n\n### **Buttons Locations**\n![Button Location](image-51.png)\n\n### **Button Pin Mapping**\n![Button Pin Mapping](image-522.png)\n\n## **Code Structure**\n\n### **Main Application (`main.c`)**\nHandles the interrupt setup, button state reading, and LED updates based on the button logic.\n\n### **Buttons Module (`buttons.c` and `buttons.h`)**\n- Initializes button GPIOs.\n- Configures interrupts for button presses.\n\n## 🔗 Quick Links\n\n- [📁 Back to Nordic-Semiconductor Projects](https://github.com/Amid68/Amid68/blob/main/projects/embedded_projects.md#nordic-semiconductor-nrf52840)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famid68%2Fnrf52840_led_button_interrupt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famid68%2Fnrf52840_led_button_interrupt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famid68%2Fnrf52840_led_button_interrupt/lists"}