Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********* Pleasedontcode.com **********
- Pleasedontcode thanks you for automatic code generation! Enjoy your code!
- - Terms and Conditions:
- You have a non-exclusive, revocable, worldwide, royalty-free license
- for personal and commercial use. Attribution is optional; modifications
- are allowed, but you're responsible for code maintenance. We're not
- liable for any loss or damage. For full terms,
- please visit pleasedontcode.com/termsandconditions.
- - Project: **LED Blinker**
- - Source Code NOT compiled for: Arduino Uno
- - Source Code created on: 2025-01-07 06:32:55
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* Add 2 more led output and blink a led in different */
- /* timings with 3 seconds delay continuosly */
- /****** END SYSTEM REQUIREMENTS *****/
- /* START CODE */
- /****** DEFINITION OF LIBRARIES *****/
- #include <Arduino.h> // Include Arduino library for basic functions
- /****** FUNCTION PROTOTYPES *****/
- void setup(void);
- void loop(void);
- const int led1 = 13; // LED on pin 13
- const int led2 = 12; // LED on pin 12
- const int led3 = 11; // LED on pin 11
- void setup(void)
- {
- // put your setup code here, to run once:
- pinMode(led1, OUTPUT); // Set pin 13 as an output for the first LED
- pinMode(led2, OUTPUT); // Set pin 12 as an output for the second LED
- pinMode(led3, OUTPUT); // Set pin 11 as an output for the third LED
- Serial.begin(9600); // Initialize serial communication at 9600 baud
- }
- void loop(void)
- {
- // Blink the first LED
- digitalWrite(led1, HIGH); // Turn the first LED on
- delay(1000); // Wait for 1 second
- Serial.write("LED 1 ON"); // Send "LED 1 ON" to the serial port
- digitalWrite(led1, LOW); // Turn the first LED off
- delay(1000); // Wait for 1 second
- Serial.write("LED 1 OFF"); // Send "LED 1 OFF" to the serial port
- // Blink the second LED
- digitalWrite(led2, HIGH); // Turn the second LED on
- delay(2000); // Wait for 2 seconds
- Serial.write("LED 2 ON"); // Send "LED 2 ON" to the serial port
- digitalWrite(led2, LOW); // Turn the second LED off
- delay(2000); // Wait for 2 seconds
- Serial.write("LED 2 OFF"); // Send "LED 2 OFF" to the serial port
- // Blink the third LED
- digitalWrite(led3, HIGH); // Turn the third LED on
- delay(3000); // Wait for 3 seconds
- Serial.write("LED 3 ON"); // Send "LED 3 ON" to the serial port
- digitalWrite(led3, LOW); // Turn the third LED off
- delay(3000); // Wait for 3 seconds
- Serial.write("LED 3 OFF"); // Send "LED 3 OFF" to the serial port
- }
- /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement