diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..ebe408f Binary files /dev/null and b/.DS_Store differ diff --git a/.gitattributes b/.gitattributes index dfe0770..28dd334 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,35 @@ -# Auto detect text files and perform LF normalization -* text=auto +# ----------------------------------------------------------- +# Git Attributes for Arduino Projects +# Ensures consistent line endings, clean diffs, and proper +# language detection on GitHub. +# ----------------------------------------------------------- + +# Automatically normalize line endings (cross-platform safe) +* text=auto eol=lf + +# Treat Arduino sketch files as text for proper diffs +*.ino text diff + +# Explicitly mark common text-based files +*.cpp text diff +*.h text diff +*.c text diff +*.md text diff +*.txt text diff + +# Treat image and binary files properly (no diffs) +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.bmp binary +*.zip binary +*.exe binary + +# Optional: tell GitHub Linguist which files are documentation +*.md linguist-documentation=true + +# Optional: ignore build artifacts and OS files from stats +*.hex linguist-generated=true +*.bin linguist-generated=true +.DS_Store linguist-vendored=true diff --git a/Advanced/Button_Control/Button_Control.ino b/Advanced/Button_Control/Button_Control.ino new file mode 100644 index 0000000..0b45c49 --- /dev/null +++ b/Advanced/Button_Control/Button_Control.ino @@ -0,0 +1,30 @@ +/* + Button Control + -------------- + Demonstrates how to control an LED using a push button. + When the button is pressed, the LED turns on; otherwise, it turns off. + + Hardware setup: + - LED connected to pin 9 through a 220Ω resistor. Also works without + - Push button connected between pin 2 and ground + - Uses the internal pull-up resistor for stable input +*/ + +const int buttonPin = 2; +const int ledPin = 9; +int buttonState = 0; + +void setup() { + pinMode(ledPin, OUTPUT); + pinMode(buttonPin, INPUT_PULLUP); // internal pull-up, so LOW = pressed +} + +void loop() { + buttonState = digitalRead(buttonPin); + + if (buttonState == LOW) { + digitalWrite(ledPin, HIGH); // Button pressed + } else { + digitalWrite(ledPin, LOW); // Button released + } +} diff --git a/Advanced/Button_Control/README.md b/Advanced/Button_Control/README.md new file mode 100644 index 0000000..9dd4ff0 --- /dev/null +++ b/Advanced/Button_Control/README.md @@ -0,0 +1,14 @@ +# Button Control Example + +This example demonstrates how to use a push button to control an LED. + +## What You Learn +- Reading digital input from a button +- Using `INPUT_PULLUP` for reliable button detection +- Applying conditional logic with `if` statements + +## Circuit +- LED connected to pin 9 (with a 220Ω resistor(actually does not matter)) +- Button connected to pin 2 and ground + +When the button is pressed, the LED turns on. This is your first step into interactive Arduino projects. diff --git a/Advanced/Knight_Rider/Knight_Rider.ino b/Advanced/Knight_Rider/Knight_Rider.ino new file mode 100644 index 0000000..012adbb --- /dev/null +++ b/Advanced/Knight_Rider/Knight_Rider.ino @@ -0,0 +1,24 @@ +const int ledPins[] = {3, 5, 6, 9, 10}; // LED pins +int numLeds = 5; + +void setup() { + for(int i = 0; i < numLeds; i++) { + pinMode(ledPins[i], OUTPUT); // set all LED pins as output + } +} + +void loop() { + // forward sequence + for(int i = 0; i < numLeds; i++) { + digitalWrite(ledPins[i], HIGH); // turn LED on + delay(100); // wait + digitalWrite(ledPins[i], LOW); // turn LED off + } + + // backward sequence + for(int i = numLeds - 2; i > 0; i--) { + digitalWrite(ledPins[i], HIGH); + delay(100); + digitalWrite(ledPins[i], LOW); + } +} diff --git a/Advanced/Knight_Rider/README.md b/Advanced/Knight_Rider/README.md new file mode 100644 index 0000000..3cf40e8 --- /dev/null +++ b/Advanced/Knight_Rider/README.md @@ -0,0 +1,16 @@ +# Knight Rider LED Example + +This project creates a "Knight Rider" running light effect with multiple LEDs. + +## What You Learn +- Sequencing multiple LEDs +- Forward and backward animation +- Timing and delays + +## Hardware +- 5 LEDs connected to pins 3, 5, 6, 9, 10 +- 220Ω resistors(you know, it does not matter..) + +## How It Works +The LEDs turn on one after another in a forward sequence, then in a reverse sequence, simulating the famous +Knight Rider effect. \ No newline at end of file diff --git a/Advanced/PWM_Fading/PWM_Fading.ino b/Advanced/PWM_Fading/PWM_Fading.ino new file mode 100644 index 0000000..758f8bb --- /dev/null +++ b/Advanced/PWM_Fading/PWM_Fading.ino @@ -0,0 +1,19 @@ +const int ledPin = 9; // PWM-capable pin +int brightness = 0; // current brightness level +int fadeAmount = 5; // amount to change the brightness + +void setup() { + pinMode(ledPin, OUTPUT); // set the LED pin as output +} + +void loop() { + analogWrite(ledPin, brightness); // set the LED brightness + brightness += fadeAmount; // increase or decrease brightness + + // reverse direction at the ends + if(brightness <= 0 || brightness >= 255) { + fadeAmount = -fadeAmount; + } + + delay(30); // wait for 30 milliseconds +} diff --git a/Advanced/PWM_Fading/README.md b/Advanced/PWM_Fading/README.md new file mode 100644 index 0000000..b64b928 --- /dev/null +++ b/Advanced/PWM_Fading/README.md @@ -0,0 +1,16 @@ +# PWM Fading Example + +This example demonstrates how to fade an LED smoothly using PWM (Pulse Width Modulation). + +## What You Learn +- Using `analogWrite()` to control LED brightness +- Creating smooth increasing and decreasing loops +- Handling boundary conditions for variables + +## Hardware +- 1 LED connected to PWM pin 9 +- 220Ω resistor(actually does'nt matter..) + +## How It Works +The LED brightness increases and decreases gradually. The program reverses the fade direction when reaching the +minimum or maximum brightness, creating a continuous fading effect. diff --git a/Advanced/Patterns/Patterns.ino b/Advanced/Patterns/Patterns.ino new file mode 100644 index 0000000..cd1c2d5 --- /dev/null +++ b/Advanced/Patterns/Patterns.ino @@ -0,0 +1,44 @@ +/* + Patterns + -------- + Demonstrates how to create repeating LED patterns. + Uses loops and arrays to build structured light effects. + + Hardware setup: + - 4 LEDs connected to pins 8, 9, 10, and 11 (each with 220Ω resistors(does not matter)) +*/ + +int leds[] = {8, 9, 10, 11}; +int numLeds = 4; + +void setup() { + for (int i = 0; i < numLeds; i++) { + pinMode(leds[i], OUTPUT); + } +} + +void loop() { + // Pattern 1: Forward chase + for (int i = 0; i < numLeds; i++) { + digitalWrite(leds[i], HIGH); + delay(150); + digitalWrite(leds[i], LOW); + } + + // Pattern 2: Reverse chase + for (int i = numLeds - 1; i >= 0; i--) { + digitalWrite(leds[i], HIGH); + delay(150); + digitalWrite(leds[i], LOW); + } + + // Pattern 3: Blink all LEDs + for (int i = 0; i < numLeds; i++) { + digitalWrite(leds[i], HIGH); + } + delay(300); + for (int i = 0; i < numLeds; i++) { + digitalWrite(leds[i], LOW); + } + delay(300); +} diff --git a/Advanced/Patterns/README.md b/Advanced/Patterns/README.md new file mode 100644 index 0000000..b57b60f --- /dev/null +++ b/Advanced/Patterns/README.md @@ -0,0 +1,14 @@ +# LED Patterns Example + +This example shows how to create LED patterns using loops and arrays. + +## What You Learn +- Using arrays to control multiple pins +- Creating sequential and reverse lighting patterns +- Managing timing with the `delay()` function + +## Circuit +- Four LEDs connected to pins 8–11 (each with a 220Ω resistor(does'nt matter)) +- Common ground connection + +These patterns help you practice structured programming and timing logic. diff --git a/Advanced/README.md b/Advanced/README.md new file mode 100644 index 0000000..35222d4 --- /dev/null +++ b/Advanced/README.md @@ -0,0 +1,43 @@ +# Advanced Arduino LED Projects + +This folder contains advanced LED projects for learners who have completed the basics. + +## Projects Overview + +### Button Control +- **Folder:** Button_Control/ +- **Purpose:** Learn interactive LED control using a push button. +- **Learnings:** Digital input reading, conditional logic, debouncing. +- **Hardware:** LEDs, push button, 220Ω resistors. + +### Patterns +- **Folder:** Patterns/ +- **Purpose:** Structured LED sequences to understand loops and arrays. +- **Learnings:** Arrays, loops, timing with `delay()`. +- **Hardware:** 4 LEDs, 220Ω resistors. + +### Random Effects +- **Folder:** Random_Effects/ +- **Purpose:** Dynamic and unpredictable LED effects. +- **Learnings:** `random()` usage, `randomSeed()`, creating dynamic animations. +- **Hardware:** 3 LEDs, 220Ω resistors. + +### PWM Fading +- **Folder:** PWM_Fading/ +- **Purpose:** Smooth LED fading using PWM. +- **Learnings:** `analogWrite()`, loops, variable increments. +- **Hardware:** 1 LED on PWM pin, 220Ω resistor. + +### Knight Rider +- **Folder:** Knight_Rider/ +- **Purpose:** Running light effect forward and backward. +- **Learnings:** Sequencing, forward/backward animation, timing control. +- **Hardware:** 5 LEDs, 220Ω resistors. + +--- + +## Learning Goals +- Advanced LED control techniques. +- Sequencing, animation, and PWM usage. +- Interactive controls with buttons. +- Structuring multiple Arduino projects professionally. \ No newline at end of file diff --git a/Advanced/Random_Effects/README.md b/Advanced/Random_Effects/README.md new file mode 100644 index 0000000..5e10474 --- /dev/null +++ b/Advanced/Random_Effects/README.md @@ -0,0 +1,14 @@ +# Random LED Effects Example + +This example uses the `random()` function to create unpredictable LED lighting. + +## What You Learn +- Generating random numbers with `random()` and `randomSeed()` +- Creating dynamic, non-repetitive LED effects +- Combining randomness with control logic + +## Circuit +- Three LEDs connected to pins 8–10 (each with a 220Ω resistor(really does'nt matter(for short life LED))) +- Common ground connection + +Adding randomness makes LED projects look more organic and fun. diff --git a/Advanced/Random_Effects/Random_Effects.ino b/Advanced/Random_Effects/Random_Effects.ino new file mode 100644 index 0000000..eefd784 --- /dev/null +++ b/Advanced/Random_Effects/Random_Effects.ino @@ -0,0 +1,28 @@ +/* + Random Effects + --------------- + Demonstrates how to use the random() function to create unpredictable LED behavior. + + Hardware setup: + - 3 LEDs connected to pins 8, 9, and 10 through 220Ω resistors(resrstors does'nt matter) +*/ + +int leds[] = {8, 9, 10}; +int numLeds = 3; + +void setup() { + for (int i = 0; i < numLeds; i++) { + pinMode(leds[i], OUTPUT); + } + + randomSeed(analogRead(0)); // initialize random generator +} + +void loop() { + int ledIndex = random(0, numLeds); // pick a random LED + int delayTime = random(100, 700); // random delay + + digitalWrite(leds[ledIndex], HIGH); + delay(delayTime); + digitalWrite(leds[ledIndex], LOW); +} diff --git a/Basics/Blink/Blink.ino b/Basics/Blink/Blink.ino new file mode 100644 index 0000000..c9d8821 --- /dev/null +++ b/Basics/Blink/Blink.ino @@ -0,0 +1,21 @@ +/* + Blink + ----- + The simplest example to start with Arduino. + This program turns an LED on for one second, then off for one second, repeatedly. + + Hardware setup: + - Connect an LED to digital pin 13 through a 220Ω resistor or without. Does not matter. +*/ + +void setup() { + // Initialize digital pin 13 as an output. + pinMode(13, OUTPUT); +} + +void loop() { + digitalWrite(13, HIGH); // Turn the LED on + delay(1000); // Wait for one second + digitalWrite(13, LOW); // Turn the LED off + delay(1000); // Wait for one second +} \ No newline at end of file diff --git a/Basics/Blink/Blink_with_random_Delay.ino b/Basics/Blink/Blink_with_random_Delay.ino new file mode 100644 index 0000000..1f4f96f --- /dev/null +++ b/Basics/Blink/Blink_with_random_Delay.ino @@ -0,0 +1,23 @@ +// led is on Pin 3 +const int led = 3; + +void setup() { + // led Pin(3) has Power OUTPUT + pinMode(led, OUTPUT); +} + +void loop() { + // brightness is random + int brightness = random(55, 255); + // onTime is between 0,1 and 0,3 seconds + int onTime = random(100, 300); + // offTime is between 0,1 and 0,19 seconds + int offTime = random(100, 190); + + digitalWrite(led, brightness); + // as delay, we take our defined onTime + delay(onTime); + digitalWrite(LOW); + // as delay, we take our defined offTime + delay(offTime); +} diff --git a/Basics/Blink/README.md b/Basics/Blink/README.md new file mode 100644 index 0000000..8b13d53 --- /dev/null +++ b/Basics/Blink/README.md @@ -0,0 +1,14 @@ +# Blink Example + +The most basic Arduino example — making an LED blink on and off. + +## What You Learn +- How to set up an output pin +- The use of `digitalWrite()` and `delay()` +- The structure of `setup()` and `loop()` functions + +## Circuit +- LED connected to pin 13 (through a 220Ω resistor) +- Ground connected to the LED’s cathode + +This example introduces the fundamental concept of digital output control in Arduino. \ No newline at end of file diff --git a/Basics/Fade/Fade.ino b/Basics/Fade/Fade.ino new file mode 100644 index 0000000..431c755 --- /dev/null +++ b/Basics/Fade/Fade.ino @@ -0,0 +1,29 @@ +/* + Fade + ---- + Demonstrates the use of PWM (Pulse Width Modulation) to control LED brightness. + The LED will gradually fade in and out. + + Hardware setup: + - LED connected to pin 9 through a 220Ω resistor. +*/ + +int led = 9; // PWM-capable pin +int brightness = 0; // Current brightness level +int fadeAmount = 5; // Amount to change brightness each step + +void setup() { + pinMode(led, OUTPUT); +} + +void loop() { + analogWrite(led, brightness); // Set LED brightness + brightness = brightness + fadeAmount; + + // Reverse direction at limits + if (brightness <= 0 || brightness >= 255) { + fadeAmount = -fadeAmount; + } + + delay(30); // Adjust speed of fade +} diff --git a/Basics/Fade/README.md b/Basics/Fade/README.md new file mode 100644 index 0000000..29f57a4 --- /dev/null +++ b/Basics/Fade/README.md @@ -0,0 +1,15 @@ +# Fade Example + +This example introduces analog control through PWM (Pulse Width Modulation) to vary LED brightness smoothly. + +## What You Learn +- How to use `analogWrite()` for PWM control +- How to create smooth transitions with variables +- The concept of analog output in Arduino + +## Circuit +- LED connected to pin 9 (PWM-capable) +- 220Ω resistor between pin and LED + +This project helps you understand how to simulate analog control digitally — essential for dimming lights or +controlling motors. diff --git a/Basics/Multiple_LEDs/Multiple_LEDs.ino b/Basics/Multiple_LEDs/Multiple_LEDs.ino new file mode 100644 index 0000000..c7f594d --- /dev/null +++ b/Basics/Multiple_LEDs/Multiple_LEDs.ino @@ -0,0 +1,28 @@ +/* + Multiple LEDs + ------------- + This example shows how to control multiple LEDs one after another. + Each LED turns on and off in sequence. + + Hardware setup: + - 3 LEDs connected to pins 8, 9, and 10 (through 220Ω resistors). +*/ + +int ledPins[] = {8, 9, 10}; // LED pins +int numLeds = 3; // Number of LEDs + +void setup() { + // Set all LED pins as outputs + for (int i = 0; i < numLeds; i++) { + pinMode(ledPins[i], OUTPUT); + } +} + +void loop() { + // Turn each LED on and off in sequence + for (int i = 0; i < numLeds; i++) { + digitalWrite(ledPins[i], HIGH); // LED on + delay(500); // LED is on for half a second + digitalWrite(ledPins[i], LOW); // LED off + } +} \ No newline at end of file diff --git a/Basics/Multiple_LEDs/Multiple_LEDs_random_time.ino b/Basics/Multiple_LEDs/Multiple_LEDs_random_time.ino new file mode 100644 index 0000000..dc0228f --- /dev/null +++ b/Basics/Multiple_LEDs/Multiple_LEDs_random_time.ino @@ -0,0 +1,20 @@ +const int ledPins[] = {3, 6, 9}; +int numLeds = 3; + +void setup() { + for (int i = 0; i < numLeds; i++) { + pinMode(ledPins[i], OUTPUT); + } +} + +void loop() { + int onTime = random(50, 200); + int offTime = random(40, 180); + + for (int i = 0; i < numLeds; i++) { + digitalWrite(ledPins[i], HIGH); + delay(onTime); + digitalWrite(ledPins[i], LOW); + delay(offTime); + } +} diff --git a/Basics/Multiple_LEDs/README.md b/Basics/Multiple_LEDs/README.md new file mode 100644 index 0000000..63439f2 --- /dev/null +++ b/Basics/Multiple_LEDs/README.md @@ -0,0 +1,15 @@ +# Multiple LEDs Example + +This example demonstrates how to control several LEDs in sequence using loops. + +## What You Learn +- How to use arrays to manage multiple output pins +- How to iterate with `for` loops +The use od `delay` for `onTime` and `offTime` +- Sequential LED control + +## Circuit +- Three LEDs connected to pins 8, 9, and 10 +- Each LED connected through a 220Ω resistor to ground. Actually does not matter. + +This example builds on the basics by introducing arrays and loop structures. \ No newline at end of file diff --git a/Basics/README.md b/Basics/README.md new file mode 100644 index 0000000..a033d2f --- /dev/null +++ b/Basics/README.md @@ -0,0 +1,32 @@ +# Arduino LED Basics + +This section introduces the fundamental concepts of Arduino LED programming. +You’ll learn how to control LEDs, understand digital outputs, and build confidence with simple circuits. + +## Included Examples +- **Blink:** The classic first Arduino program — turn an LED on and off at regular intervals. +- **Multiple LEDs:** Control several LEDs independently using loops and pin arrays. +- **Fade:** Create smooth LED brightness transitions using PWM (Pulse Width Modulation). + +## What You Learn +- How to use `pinMode()` and `digitalWrite()` to control pins +- How to work with time delays using `delay()` +- Introduction to `analogWrite()` for dimming LEDs +- Basic use of loops (`for`) for repetitive tasks + +## Circuit Requirements +- 1–3 LEDs (any color) +- 220Ω resistors(Does not matter..) +- Jumper wires +- Breadboard +- Arduino board (e.g., Uno, Nano, or Mega) + +## Learning Goal +By completing the Basics section, you will: +- Understand how Arduino handles digital output +- Gain confidence with simple electronic components +- Be ready to move on to **interactive and advanced LED projects** + +--- + +> 💡 Tip: Experiment by changing delay times, brightness levels, or pin numbers to explore how each adjustment affects behavior. diff --git a/Code_Templates_with_examples/Advanced/PWM_Breathing_Template.ino b/Code_Templates_with_examples/Advanced/PWM_Breathing_Template.ino new file mode 100644 index 0000000..e9bbb19 --- /dev/null +++ b/Code_Templates_with_examples/Advanced/PWM_Breathing_Template.ino @@ -0,0 +1,21 @@ +// PWM Breathing LED Template +// Smoothly increases and decreases LED brightness using PWM. + +const int ledPin = 9; +int brightness = 0; +int fadeAmount = 5; + +void setup() { + pinMode(ledPin, OUTPUT); +} + +void loop() { + analogWrite(ledPin, brightness); // Set LED brightness + brightness += fadeAmount; + + if(brightness <= 0 || brightness >= 255){ + fadeAmount = -fadeAmount; // Reverse direction + } + + delay(30); // Smooth transition +} diff --git a/Code_Templates_with_examples/Basics/Blink_Template.ino b/Code_Templates_with_examples/Basics/Blink_Template.ino new file mode 100644 index 0000000..f0990e3 --- /dev/null +++ b/Code_Templates_with_examples/Basics/Blink_Template.ino @@ -0,0 +1,17 @@ +// Blink Template +// Simple example of turning an LED on and off repeatedly. + +const int ledPin = 13; // Built-in LED +const int ON_TIME = 500; +const int OFF_TIME = 500; + +void setup() { + pinMode(ledPin, OUTPUT); // Set LED pin as output +} + +void loop() { + digitalWrite(ledPin, HIGH); // Turn LED on + delay(ON_TIME); + digitalWrite(ledPin, LOW); // Turn LED off + delay(OFF_TIME); +} diff --git a/Code_Templates_with_examples/Basics/Button_Input.ino b/Code_Templates_with_examples/Basics/Button_Input.ino new file mode 100644 index 0000000..4d094c4 --- /dev/null +++ b/Code_Templates_with_examples/Basics/Button_Input.ino @@ -0,0 +1,19 @@ +// Button Input Template +// Reads a button press and toggles an LED. + +const int ledPin = 13; +const int buttonPin = 2; +bool ledState = false; + +void setup() { + pinMode(ledPin, OUTPUT); + pinMode(buttonPin, INPUT_PULLUP); // Button with internal pull-up +} + +void loop() { + if(digitalRead(buttonPin) == LOW){ // Button pressed + ledState = !ledState; // Toggle LED state + digitalWrite(ledPin, ledState); + delay(200); // Debounce + } +} diff --git a/Code_Templates_with_examples/README.md b/Code_Templates_with_examples/README.md new file mode 100644 index 0000000..3021eef --- /dev/null +++ b/Code_Templates_with_examples/README.md @@ -0,0 +1,28 @@ +# Code Templates with Examples + +This folder contains general Arduino code templates for both beginners and advanced learners. +The templates are designed to provide a starting point for creating new projects and understanding common Arduino programming concepts. + +## Basics +1. **Blink_Template.ino** + - Blinks an LED repeatedly. + - Teaches digital output and timing with `delay()`. + +2. **Button_Input_Template.ino** + - Reads a button press and toggles an LED. + - Teaches digital input, state toggling, and simple debounce. + +## Advanced +1. **PWM_Breathing_Template.ino** + - Smoothly increases and decreases LED brightness using PWM. + - Teaches `analogWrite()` and creating smooth animations. + +2. **LED_Sequence_Template.ino** + - Turns multiple LEDs on in a sequence and then back. + - Teaches arrays, loops, and sequencing multiple outputs. + +## How to Use +- Open any template `.ino` file in the Arduino IDE. +- Connect the necessary components according to the code comments. +- Upload the sketch to your Arduino board and observe the behavior. +- Modify variables and loops to experiment and learn. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..996c54c --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 der-programmer1. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index ecdab72..68f24fa 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,72 @@ -# Arduino_Led_Programming -Here, you can fing interesting Arduino Code for LED's +# 🎛️ Arduino Projects Hub + +Welcome to my **Arduino Projects Hub**, a growing collection of interactive hardware experiments. +This repository includes **LEDs, buzzers, sensors, and more**, with projects designed for **learning, prototyping, and creative experimentation**. + +![Demo](docs/demo.gif) + +--- + +## 🌟 Current Features + +- Randomized LED patterns and blinking experiments +- Buzzer tone generation with configurable randomness +- Basic input/output projects for Arduino beginners +- Configurable timing, patterns, and hardware assignments +- No external libraries required (most projects) + +--- + +## 🔮 Future Plans + +- Expand with **more sensors** (temperature, light, motion) +- Add **interactive projects** (buttons, switches, user input) +- Create **multi-device synchronization** examples +- Include **advanced LED and buzzer patterns** +- Document and demo projects with GIFs, schematics, and tutorials + +--- + +## 🛠️ Hardware Overview + +- Arduino Uno, Nano, or compatible boards +- LEDs, buzzers, resistors, and other basic components +- Jumper wires, breadboards, and optional sensors +- Flexible setup: the repository is not limited to a specific number of components + +--- + +## 📦 How to Use + +1. Browse the project folders in the repository +2. Open the `.ino` files in **Arduino IDE** +3. Connect the required hardware according to the folder/project description +4. Upload and run sketches +5. Experiment with timings, pins, and patterns to customize the behavior + +> Each project contains notes on **hardware setup, pin assignments, and configuration** to make it easy to start experimenting. + +--- + +## 🤝 Contributing + +Contributions, bug reports, or feature suggestions are **welcome**. + +- Fork the repository +- Add your project or improvements +- Submit a Pull Request +- Document your changes and any new hardware used + +--- + +## 📄 License + +All projects in this repository are under the **MIT License** – see [LICENSE](LICENSE) for details. + +--- + +## 📞 Contact + +Questions, suggestions, or feedback? Contact me at [your-email@example.com] + +Follow me on GitHub for updates: [https://github.com/der-programmer1](https://github.com/der-programmer1) diff --git a/buzzer_Codes/basic_Buzzer_LED_Code/basic_Buzzer_Code.ino b/buzzer_Codes/basic_Buzzer_LED_Code/basic_Buzzer_Code.ino new file mode 100644 index 0000000..f449d3f --- /dev/null +++ b/buzzer_Codes/basic_Buzzer_LED_Code/basic_Buzzer_Code.ino @@ -0,0 +1,17 @@ +// define Buzzer on Pin 9 +const int Buzzer = 9; + +void setup() { + // set Buzzer Pin as an OUTPUT + pinMode(buzzer, OUTPUT); +} + +void loop() { + // buzzer Power is 0,3 KHz + tone(buzzer, 300); + // onTime for Buzzer are 0,3 seconds + delay(300); + noTone(buzzer); + // offTime for buzzer are 0,3 seconds + delay(300); +} diff --git a/buzzer_Codes/basic_Buzzer_LED_Code/basic_Buzzer_LED_Code_the_Template b/buzzer_Codes/basic_Buzzer_LED_Code/basic_Buzzer_LED_Code_the_Template new file mode 100644 index 0000000..e873acb --- /dev/null +++ b/buzzer_Codes/basic_Buzzer_LED_Code/basic_Buzzer_LED_Code_the_Template @@ -0,0 +1,14 @@ +// define Buzzer and led on Pin(9, for example(... = 9;)) +const int Buzzer, led = ; + +void setup() { + // set Buzzer Pin as an OUTPUT(is already) + pinMode(buzzer, OUTPUT); +} + +void loop() { + tone(buzzer, ); // set power in KHz. 1000 = 1KHz(make between 0,1 and 1 KHz) + delay(); // set the onTime in seconds. 1000 = 1 second + noTone(buzzer); + delay(); // set the offTime in seconds +} diff --git a/buzzer_Codes/buzzer_with_random/Buzzer_with_random.ino b/buzzer_Codes/buzzer_with_random/Buzzer_with_random.ino new file mode 100644 index 0000000..664604f --- /dev/null +++ b/buzzer_Codes/buzzer_with_random/Buzzer_with_random.ino @@ -0,0 +1,20 @@ +// Buzzer is defined on Pin 9 +const int buzzer = 9; +// onTime for buzzer us between 0,05 and 0,23 seconds long. same with offTime +int onTime = random(50, 400); +int offTIme = random(50, 230); +// OUTPUT Power for buzzer is between 0,05 and 0,35 KHz +int buzzerPower = random(50, 350); + +void setup() { + pinMode(buzzer, OUTPUT); +} + +void loop() { + // for the tone, we use our defined buzzerPower + tone(buzzer, buzzerPower); + // onTime also is what we defined... also offTime + delay(onTime); + noTone(buzzer); + delay(offTime); +} diff --git a/buzzer_Codes/buzzer_with_random/buzzer_with_random_the_template b/buzzer_Codes/buzzer_with_random/buzzer_with_random_the_template new file mode 100644 index 0000000..d0f3e3f --- /dev/null +++ b/buzzer_Codes/buzzer_with_random/buzzer_with_random_the_template @@ -0,0 +1,15 @@ +const int buzzer = ; // set Pin for buzzer. 9 for example +int onTime = random(, ); // set min. and max. time delay +int offTIme = random(, ); // set min. and max. time delay +int buzzerPower = random( , ); // set min. and max. power. 1000 is 1 KHz(set between 0,1 and 1) + +void setup() { + pinMode(buzzer, OUTPUT); +} + +void loop() { + tone(buzzer, buzzerPower); + delay(onTime); + noTone(buzzer); + delay(offTime); +}