Components and supplies
3
Jumper wires (generic)
1
Arduino UNO
1
SG90 Micro-servo motor
Apps and platforms
1
Arduino IDE
Project description
Code
Servo
c_cpp
Servo
c_cpp
Downloadable files
Servo
Servo

Comments
Only logged in users can leave comments
Components and supplies
Jumper wires (generic)
Arduino UNO
SG90 Micro-servo motor
Apps and platforms
Arduino IDE
Project description
Code
Servo
c_cpp
1#include <Servo.h> 2 3Servo myservo; 4 5int pos = 0; 6 7void setup() { 8 myservo.attach(9); //pin ~9 9} 10 11void loop() { 12 for (pos = 0; pos <= 180; pos += 1) { 13 myservo.write(pos); 14 delay(15); 15 } 16 for (pos = 180; pos >= 0; pos -= 1) { 17 myservo.write(pos); 18 delay(15); 19 } 20} 21
Servo
c_cpp
1#include <Servo.h> 2 3Servo myservo; 4 5int pos = 0; 6 7void 8 setup() { 9 myservo.attach(9); //pin ~9 10} 11 12void loop() { 13 for (pos 14 = 0; pos <= 180; pos += 1) { 15 myservo.write(pos); 16 delay(15); 17 18 } 19 for (pos = 180; pos >= 0; pos -= 1) { 20 myservo.write(pos); 21 22 delay(15); 23 } 24} 25
Downloadable files
Servo
Servo

Comments
Only logged in users can leave comments