Aniket Singh

Aniket Singh

|

@aniketxai

I’m a Full Stack Developer and IoT/Arduino Innovator. I build smart web apps and intelligent devices. On this site, I share coding tutorials, tech projects, and blogs related to web dev, embedded systems, and startup building.

🚀 View Projects
MERN Web Dev Arduino JavaScript Java DSA

Skills

HTML/CSS
JavaScript
React/MERN
IoT & Arduino

how to control servo motor using nodemcu



 Hello Guys,In this post we learn how to control servo motor using nodemcu in easy way.

Let Start it:-

*specification

-you can use to control servo motor.

-In easy way

-cheap in price.

*Parts Required



1.Nodemcu

2.Servo Motor

*Schematics & Diagrams


-do all the connection according to this diagram.

-connect 3 volt to red and black wire and orange wire to D4.

*Lets coding time

-Copy The following code in ardunio ide

/*********
-Tech Gyan Creative
Complete project details at https://techgyancreative.blogspot.com
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
*********/


// Import required libraries

#include <Servo.h>

Servo servo;

void setup() {

servo.attach(2); //D4

servo.write(0);

delay(2000);

}

void loop() {

servo.write(90);

delay(1000);

servo.write(0);

delay(1000);

}

-choose your com port and board type

-upload the code

*Preview







1 comment

  1. Aniket Roy
    Nice 😊bro I like your all project