{"id":26044373,"url":"https://github.com/rezagooner/traffic-light-with-counter","last_synced_at":"2026-04-22T07:35:31.476Z","repository":{"id":281090875,"uuid":"944173758","full_name":"RezaGooner/Traffic-Light-with-Counter","owner":"RezaGooner","description":"This repository contains C code(Code vision file)  and Proteus simulation files for a traffic light control system. The system includes three lights (red, yellow, and green) and a two-digit counter to display the remaining time for each light. The duration of each light can be adjusted in real-time using buttons.","archived":false,"fork":false,"pushed_at":"2025-03-07T00:16:25.000Z","size":114,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-07T00:19:21.757Z","etag":null,"topics":["arduino","atmega32","cprogramming","electronics","embeddedsystems","ledcontrol","microcontroller","proteuside","proteussimulation","simulation","timers","trafficcontrol","trafficlight"],"latest_commit_sha":null,"homepage":"","language":"Assembly","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/RezaGooner.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":"2025-03-06T22:52:36.000Z","updated_at":"2025-03-07T00:16:29.000Z","dependencies_parsed_at":"2025-03-07T00:19:23.930Z","dependency_job_id":"7cb52102-f1b5-4e5d-bfa5-9cb25a55257b","html_url":"https://github.com/RezaGooner/Traffic-Light-with-Counter","commit_stats":null,"previous_names":["rezagooner/traffic-light-with-counter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RezaGooner%2FTraffic-Light-with-Counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RezaGooner%2FTraffic-Light-with-Counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RezaGooner%2FTraffic-Light-with-Counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RezaGooner%2FTraffic-Light-with-Counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RezaGooner","download_url":"https://codeload.github.com/RezaGooner/Traffic-Light-with-Counter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242437707,"owners_count":20128090,"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","atmega32","cprogramming","electronics","embeddedsystems","ledcontrol","microcontroller","proteuside","proteussimulation","simulation","timers","trafficcontrol","trafficlight"],"created_at":"2025-03-07T18:19:09.214Z","updated_at":"2025-12-08T07:02:01.336Z","avatar_url":"https://github.com/RezaGooner.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n---\n\n# Traffic Light with Counter\n\nThis project implements a **traffic light system with a countdown timer** using an **ATmega32 microcontroller**. The system allows normal traffic operation, adjustable red and green light durations, a police mode, and an off mode. \n\n## 🚦 Features\n\n- **Normal Mode**: The traffic lights operate in a standard cycle (**Red → Green → Yellow**) while displaying the remaining time on a **7-segment display**.\n- **Adjustable Red Light Duration**: Users can modify the **red light duration** and see real-time updates on the **7-segment display**.\n- **Adjustable Green Light Duration**: Users can modify the **green light duration** similarly.\n- **Police Mode**: The **red light blinks**, and `\"PO\"` is displayed on the **7-segment display**.\n- **Off Mode**: Turns off all lights and the **7-segment display**.\n\n---\n\n![ezgif-4285d246e41e0c](https://github.com/user-attachments/assets/3a3a4ce5-0db2-4413-8372-6b5b0b784bf0)\n\n\u003e Graphical Guide for Operating the Circuit\n\n\n## 🛠️ Hardware Components\n\n- **ATmega32** microcontroller\n- **7-segment display (2 digits)**\n- **Push buttons** (for mode selection and time adjustment)\n- **LEDs (Red, Yellow, Green)**\n\n---\n\n## 🔧 Circuit Connections\n\n| Component | ATmega32 Pin |\n|-----------|-------------|\n| **Green LED** | `PA0` |\n| **Yellow LED** | `PA1` |\n| **Red LED** | `PA2` |\n| **7-Segment (Left - Tens Place)** | `PORTD (PD0 - PD6)` |\n| **7-Segment (Right - Ones Place)** | `PORTC (PC0 - PC6)` |\n| **Normal Mode Button** | `PB0` |\n| **Set Red Time Button** | `PB1` |\n| **Set Green Time Button** | `PB2` |\n| **Police Mode Button** | `PB3` |\n| **Off Button** | `PB4` |\n| **Increase Time (`Time+`)** | `PB5` |\n| **Decrease Time (`Time-`)** | `PB6` |\n\n---\n\n## 🎮 How to Use\n\n### **1️⃣ Normal Mode**\nPress the **Normal** button (`PB0`). The **traffic lights cycle normally**:  \n🔴 **Red → 🟢 Green → 🟡 Yellow**  \nThe **remaining time** for each light is displayed on the **7-segment display**.\n\n---\n\n### **2️⃣ Adjusting Red Light Duration**\n1. Press **Set Red** (`PB1`) to enter red time adjustment mode.  \n   - The **red LED** turns on, and the **current red light duration** is shown on the **7-segment display**.\n2. Use **Time+ (`PB5`)** to **increase** the red light duration.  \n3. Use **Time- (`PB6`)** to **decrease** the red light duration.  \n4. To **save changes**, press any other mode button (e.g., **Normal, Police, or Set Green**).\n\n---\n\n### **3️⃣ Adjusting Green Light Duration**\n1. Press **Set Green** (`PB2`) to enter green time adjustment mode.  \n   - The **green LED** turns on, and the **current green light duration** is shown on the **7-segment display**.\n2. Use **Time+ (`PB5`)** to **increase** the green light duration.  \n3. Use **Time- (`PB6`)** to **decrease** the green light duration.  \n4. To **save changes**, press any other mode button (e.g., **Normal, Police, or Set Red**).\n\n---\n\n### **4️⃣ Police Mode**\nPress the **Police** button (`PB3`).  \n- The **red LED blinks continuously**.  \n- `\"PO\"` is displayed on the **7-segment display**.\n\n---\n\n### **5️⃣ Off Mode**\nPress the **Off** button (`PB4`).  \n- **All LEDs and the 7-segment display turn off.**\n\n---\n\n## 🚀 Getting Started\n\n### **1️⃣ Clone the Repository**\n```bash\ngit clone https://github.com/RezaGooner/Traffic-Light-with-Counter.git\ncd Traffic-Light-with-Counter\n```\n\n### **2️⃣ Compile \u0026 Upload the Code**\nUse **Atmel Studio**, **AVR-GCC**, or **Arduino IDE** (if adapted for ATmega) to compile and upload the firmware.\n\n### **3️⃣ Simulate in Proteus**\n- Open the provided **Proteus** simulation file.\n- Run the simulation and test different modes.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frezagooner%2Ftraffic-light-with-counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frezagooner%2Ftraffic-light-with-counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frezagooner%2Ftraffic-light-with-counter/lists"}