I require some help to programme esp32servo SG90. Since I am using esp32 microcontroller I am using esp32 Servo header files. Normally arduino uno would use servo.h.
The thing I do not understand is how to get my servo motor to turn from 0 to 90 and 90 to 0. The codes that i try sometimes turn the servo motor one round, 2 round, 4 round, 6 round. I even followed online guides from youtube and google search engine. I don't know if it is something to do with my board but i just cant seem to write a programme to make it turn exactly 90 degrees.
If your servo moves through 360 degrees or more then it is almost certain that you have what is called a "continuous rotation servo". If so, then you will not be able to command it to a given angle as you can only control its rotation direction and speed
Try the Sweep example and report back what happens
Where did you get the servo and how are you powering it ?
If you write a value of more than 90 to it will rotate in one direction with a speed proportional to the value written. If you write a value of less than 90 to it then it will rotate in the opposite direction with a speed proportional to the value written.
Btw just out of curiousity using the heltec esp32 board can I implement a web server integration to control the servo motor motion like max foward or max reverse?
like when u press open the servo turns one side for 2-3 seconds and close the servo turns in reverse 2-3 seconds?