{"id":25939185,"url":"https://github.com/amalchandru/blinking-leds","last_synced_at":"2026-05-06T00:07:00.938Z","repository":{"id":277684604,"uuid":"933196812","full_name":"AmalChandru/Blinking-LEDs","owner":"AmalChandru","description":".ino -\u003e .c 🔥","archived":false,"fork":false,"pushed_at":"2025-02-15T12:31:24.000Z","size":1444,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T04:15:54.530Z","etag":null,"topics":["arduino","atmega328p","avr","avr-gcc","c"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AmalChandru.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":"2025-02-15T11:41:01.000Z","updated_at":"2025-02-15T12:35:14.000Z","dependencies_parsed_at":"2025-02-15T12:38:54.858Z","dependency_job_id":null,"html_url":"https://github.com/AmalChandru/Blinking-LEDs","commit_stats":null,"previous_names":["amalchandru/blinking-leds"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmalChandru%2FBlinking-LEDs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmalChandru%2FBlinking-LEDs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmalChandru%2FBlinking-LEDs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmalChandru%2FBlinking-LEDs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AmalChandru","download_url":"https://codeload.github.com/AmalChandru/Blinking-LEDs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241780495,"owners_count":20019061,"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":["arduino","atmega328p","avr","avr-gcc","c"],"created_at":"2025-03-04T04:15:56.449Z","updated_at":"2026-05-06T00:07:00.933Z","avatar_url":"https://github.com/AmalChandru.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📌 .ino -\u003e .c\n\n## 📝 Overview\nThis repository walks you through the process of transforming an Arduino Blink sketch into optimized AVR C code. The journey involves replacing high-level Arduino functions with direct hardware manipulation.\n\n## 🔧 Optimization Stages\n- ⚡ **Replacing `digitalWrite()`**: Transition from `digitalWrite()` to direct port manipulation for faster control.\n- 🛠 **Replacing `pinMode()`**: Use direct register manipulation (`DDRx`) to set pin direction.\n- ⏳ **Replacing `delay()`**: Implement a custom for-loop to replace `delay()` and reduce overhead.\n- 🎯 **Final AVR C Code**: Complete conversion to low-level AVR C code, optimizing every aspect.\n\n## 📜 Commit History\n- 🔵 **[98918db](https://github.com/AmalChandru/Blinking-LEDs/commit/98918db6975ce1adb744acdb69660f5daf91587f)**: Replaced `digitalWrite()` with direct port manipulation (`PORTB`).\n- 🔵 **[1028d2c](https://github.com/AmalChandru/Blinking-LEDs/commit/1028d2c90d6b540713abbcbbe9ffc6af6ca94e0b)**: Replaced `pinMode()` with direct register manipulation (`DDRB`).\n- 🔵 **[fede5a4](https://github.com/AmalChandru/Blinking-LEDs/commit/fede5a437513da22d48f762a576efe34cedac99e)**: Replaced `delay()` with a custom for-loop for time delay.\n- 🔵 **[4b1de20](https://github.com/AmalChandru/Blinking-LEDs/commit/4b1de204b7b84c6b345201b29f361e136b8d8444)**: Final AVR C code with all optimizations.\n- 🔵 **[4471702](https://github.com/AmalChandru/Blinking-LEDs/commit/44717023661095e0ce6e657a475755ed8c092f0f)**: A Makefile to compile and flash.\n\n## 🛠 How to Run\n\n### 📦 Install Tools\nInstall the AVR toolchain (`avr-libc`, `binutils-avr`, `gcc-avr`, `avrdude`):\n\n```sh\nsudo apt install avr-libc avrdude binutils-avr gcc-avr \n```\n\n### 📂 Clone the Repository\n\n```sh\ngit clone https://github.com/AmalChandru/Blinking-LEDs.git\ncd Blinking-LEDs\n```\n\n### 🏗 Compile\nUse `make` to compile the final code:\n\n```sh\nmake\n```\n\n### 🔥 Flash\nUpload the `.hex` file with `avrdude`:\n\n```sh\nmake upload\n```\n🎉 Enjoy the blinking LED!\n\n### 🧹 Clean\nClean object and binary files:\n```sh\nmake clean\n```\n\n## 📚 Source Material\nThis repository is the source material for the talk **[\"Blinking LEDs: For the Brave and the Curious\"](https://github.com/AmalChandru/Blinking-LEDs/blob/main/Blinking%20LEDs%3A%20For%20the%20Brave%20and%20Curious.pdf)**. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famalchandru%2Fblinking-leds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famalchandru%2Fblinking-leds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famalchandru%2Fblinking-leds/lists"}