BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Servo moving with Arduino, ESP8266, Real Time Clock

Hi! I need help with my project. I have a servomotor, and I want to use Blynk app to set the time, when this time comes, the servo should move to 80 degrees, and back to 0. I use an Arduino Uno, ESP8266, and DS3231 RTC. Could somebody help me? Please! Thank you in advance!

#include <DS3231.h>
#include <ESP8266_Lib.h>
#include <Servo.h> 
int servoPin = 9;
Servo myServo; 
int angle = 0;
DS3231  rtc(A4, A5);
Time t;
 char auth[] = "xyxyxy"; //Auth Token in the Blynk App.
  char ssid[] = "xyxyxy";// Your WiFi credentials
  char pass[] = "pw980627";// Set password to "" for open networks.
  #define ESP8266_BAUD 9600 // Your ESP8266 baud rate:
  
void setup() {
  myServo.attach(servoPin); 
  rtc.begin();
}

void loop() {
  t = rtc.getTime();
  for(angle = 0; angle < 80; angle++) 
                          {
                          myServo.write(angle); 
                          delay(400);
                          } 
  for(angle = 80; angle > 0; angle--)
                          {
                          myServo.write(angle); 
                          }```

@Nalex please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

@Nalex you’ve since edited your post, but not used the correct characters at the beginning and end of your code, despite me giving you triple backticks to copy/paste.
Please edit your post again and use the correct characters, otherwise your unformatted code will be deleted.

Pete.