Lesson 1, Topic 1
Code for Servo motor Copy
Steps to do coding in Tinkercad
1. Click the code editor button to open the coding panel.
We will code to rotate servo motor from 0 to 180 degree position and then from 180 to 0 degree position.
First we will make a variable named as “position” to store the position of servo motor.
Then we will use the “count up block” to make the servo motor rotate one by one from 0 to 180 degree position.
Now, we will put some delay and then we will use “count down block” to make the servo motor rotate in anticlockwise direction i.e. from 180 to 0 degree.