//ESP12E custom Fab using Firmware NodeMCU V1.0 with Arduino IDE //move a servo on ESP8266 ESP12-E (nodeMCU) //nodemcu pinout https://github.com/esp8266/Arduino/issues/584 #include #include Servo myservo;//servo object float prevTemp = 0; int sent = 0; int pos;//servo position void setup() { Serial.begin(115200); myservo.attach(4);//servo attach to GPIO4, after connectwifi() } void loop() { for (pos = 0; pos <= 180; pos += 1) //loop from 0 to 180 degrees to move the Servo { myservo.write(pos);//move the servo to the position delay(15);//let the servo reach the position } Serial.println("CCW"); for (pos = 180; pos >= 0; pos -= 1) //loop from 0 to 180 degrees to move the Servo { myservo.write(pos);//move the servo to the position delay(15);//let the servo reach the position } Serial.println("CW"); }