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);
}```