Hardware components | ||||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
Software apps and online services | ||||||
|
Servo motor PINOUT :
SERVO MOTOR VIDEO TUTORIAL:
#include <Servo.h> // include library
Servo Creativesolution; // identity object
void setup() {
// put your setup code here, to run once:
Creativesolution.attach(9);
}
void loop() {
// put your main code here, to run repeatedly:
Creativesolution.write(0);
delay(1000);
Creativesolution.write(90);
delay(1000);
Creativesolution.write(180);
delay(1000);
Creativesolution.write(90);
delay(1000);
}
#include <Servo.h> // include library
Servo Creativesolution; // identity object
void setup() {
// put your setup code here, to run once:
Creativesolution.attach(9);
}
void loop() {
// put your main code here, to run repeatedly:
for (int i=0; i<=180; i++){
Creativesolution.write(i);
delay(20);
}
for (int j=180; j>=0; j--){
Creativesolution.write(j);
delay(20);
}
}
Comments