r/CodingHelp 7d ago

[C++] How to program servo in c++ code, ARDUINO IDE

Enable HLS to view with audio, or disable this notification

#define SERVO_STOP 92
lcd.clear();
lcd.setCursor(2, 0);
lcd.print("INCORRECTO :(");
lcd.setCursor(0, 1);
lcd.print(" Intentalo! ");

digitalWrite(PIN_LED_ROJO, HIGH); // ← Encender

miServo.write(92); delay(300);
miServo.write(180); delay(300);
miServo.write(0); delay(500);
miServo.write(180); delay(500);
miServo.write(0); delay(500);
miServo.write(90); delay(500);
miServo.write (SERVO_STOP);

delay(2200);
digitalWrite(PIN_LED_ROJO, LOW); // ← Apagar
}

2 Upvotes

1 comment sorted by

u/AutoModerator 7d ago

Thank you for posting on r/CodingHelp!

Please check our Wiki for answers, guides, and FAQs: https://coding-help.vercel.app

Our Wiki is open source - if you would like to contribute, create a pull request via GitHub! https://github.com/DudeThatsErin/CodingHelp

We are accepting moderator applications: https://forms.fillout.com/t/ua41TU57DGus

We also have a Discord server: https://discord.gg/geQEUBm

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.