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: "Servo Setup"
- - Source Code compiled for: Arduino Uno
- - Source Code created on: 2023-12-16 10:27:53
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* led red blue */
- /****** END SYSTEM REQUIREMENTS *****/
- /****** DEFINITION OF LIBRARIES *****/
- #include <Arduino.h>
- #include <Servo.h>
- /****** FUNCTION PROTOTYPES *****/
- void setup(void);
- void loop(void);
- /***** DEFINITION OF PWM OUTPUT PINS *****/
- const uint8_t redLED_PIN = 3;
- const uint8_t blueLED_PIN = 5;
- const uint8_t servo1_PWMSignal_PIN = 6;
- /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
- Servo servo1;
- Servo servo2;
- Servo servo3;
- void setup(void)
- {
- // put your setup code here, to run once:
- pinMode(redLED_PIN, OUTPUT);
- pinMode(blueLED_PIN, OUTPUT);
- pinMode(servo1_PWMSignal_PIN, OUTPUT);
- servo1.attach(servo1_PWMSignal_PIN);
- servo2.attach(9);
- servo3.attach(10);
- }
- void loop(void)
- {
- // put your main code here, to run repeatedly:
- // System Requirement 1: Control the red and blue LEDs
- digitalWrite(redLED_PIN, HIGH);
- digitalWrite(blueLED_PIN, LOW);
- delay(1000);
- digitalWrite(redLED_PIN, LOW);
- digitalWrite(blueLED_PIN, HIGH);
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement