Keyestudio ESP32 Manual page 126

Smart robot arm kit
Hide thumbs Also See for ESP32:
Table of Contents

Advertisement

keyestudio WiKi
/*
Keyestudio ESP32 Robot Arm
9-1-5 tutorial code
Function: control the servo to rotate to 0°, 90°, 180°
http://www.keyestudio.com
*/
#include
<ESP32Servo.h>
// create a servo objects Customizable name
Servo servo;
int
servoPin
=
16;
//Connect servo to pin IO16
void
setup()
{
servo.attach(servoPin);
}
void
loop() {
servo.write(0);
delay(1000);
servo.write(90);
delay(1000);
servo.write(180);
delay(1000);
}
122
//Set servo angle to 0°
//Delay 1s
//Set servo angle to 90°
//Set servo angle to 180°
Chapter 9. 9. Robot Arm Projects

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32 and is the answer not in the manual?

Questions and answers

Related Products for Keyestudio ESP32

Table of Contents