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: **Pin Control**
- - Source Code NOT compiled for: Arduino Uno
- - Source Code created on: 2024-12-12 15:51:11
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* if i input 1 value in pin 7 then arduino pin 2 & 8 */
- /* will high */
- /****** END SYSTEM REQUIREMENTS *****/
- /* START CODE */
- /****** DEFINITION OF LIBRARIES *****/
- #include <Arduino.h>
- /****** FUNCTION PROTOTYPES *****/
- void setup(void);
- void loop(void);
- /****** PIN DEFINITIONS *****/
- const int inputPin = 7; // Input pin for reading the value
- const int outputPin1 = 2; // First output pin
- const int outputPin2 = 8; // Second output pin
- void setup(void)
- {
- // Initialize the input pin as INPUT
- pinMode(inputPin, INPUT);
- // Initialize the output pins as OUTPUT
- pinMode(outputPin1, OUTPUT);
- pinMode(outputPin2, OUTPUT);
- }
- void loop(void)
- {
- // Read the value from the input pin
- int inputValue = digitalRead(inputPin);
- // If the input value is HIGH, set the output pins HIGH
- if (inputValue == HIGH) {
- digitalWrite(outputPin1, HIGH);
- digitalWrite(outputPin2, HIGH);
- } else {
- // If the input value is LOW, set the output pins LOW
- digitalWrite(outputPin1, LOW);
- digitalWrite(outputPin2, LOW);
- }
- }
- /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement