Add the following snippet to your HTML:<iframe frameborder='0' height='385' scrolling='no' src='https://www.hackster.io/MinukaThesathYapa/arduino-servo-sweep-fd72fa/embed' width='350'></iframe>
Sweeps the shaft of a RC servo motor back and forth across 180 degrees.
Read up about this project on
#include <Servo.h> Servo myservo; int pos = 0; void setup() { myservo.attach(9); } void loop() { for (pos = 0; pos <= 180; pos += 1) { myservo.write(pos); delay(15); } for (pos = 180; pos >= 0; pos -= 1) { myservo.write(pos); delay(15); } }
Please log in or sign up to comment.
Comments
Please log in or sign up to comment.