/
Exercise 5 Solution

Exercise 5 Solution

C++

Blocks

C++

Blocks

#include <Servo.h> Servo myservo; int pos = 0; // variable to store the servo position void setup() { myservo.attach(7); } void loop() { for(pos = 0; pos <= 180; pos++) { myservo.write(pos); delay(50); } for(pos = 180; pos >= 0; pos--) { myservo.write(pos); delay(50); } }

 

image2020-1-20_18-8-41.png

 



Related content

Exercise 5
Exercise 5
More like this
Servo Motors
Servo Motors
More like this
Exercise 4 Solution
Exercise 4 Solution
More like this
Exercise 4
Exercise 4
More like this
Challenges
Challenges
More like this
Exercise 2
Exercise 2
More like this