The main idea behind this project is that there will a motor powering the boat forward.
Now to control the direction I am using a Servo motor. I am new to Blynk and need help in making the project. Some of my project details are given below :
i]Microcontroller used - ESP 32 CAM
ii]Motor used - Servo 9g motor
iii]Software used - Arduino IDE
First I was trying to control my Servo motor with a Slider
Slider MIN-0 , MAX-180
MY code -
#include "soc/soc.h"
#include "soc/rtc_cntl_reg.h"
#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "xxx"
#define BLYNK_TEMPLATE_NAME "xxx"
#define BLYNK_AUTH_TOKEN "xxx"
char ssid[] = "xxx";
char pass[] = "xxx";
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <ESP32Servo.h>
Servo servo;
BLYNK_WRITE(V2)
{
servo.write(param.asInt());
Serial.println(param.asInt());
}
void setup()
{
ESP32PWM::allocateTimer(0);
ESP32PWM::allocateTimer(1);
ESP32PWM::allocateTimer(2);
ESP32PWM::allocateTimer(3);
servo.setPeriodHertz(50);
servo.attach(16, 1000, 2000);
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0);
Serial.begin(115200);
Serial.println("WiFi connected");
Blynk.begin(BLYNK_AUTH_TOKEN,ssid,pass);
}
void loop()
{
Blynk.run();
}
I used this code to disable the brownout detector. It has no connection with the Blynk code
#include "soc/soc.h"
#include "soc/rtc_cntl_reg.h"
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0);
In the function
BLYNK_WRITE(V2)
I had also put a “Serial.println()” function
Serial.println(param.asInt());
But It is not printing a single value in the Serial monitor.
Please Help Me Control The Servo Motor And Make This Project