In this lesson we will be setting the drone to rotate clockwise and counterclockwise command name C
W stands for clockwise and we can set the x 2 1 to 360 degrees.
This is the same for counterclockwise which will be CCW for the command name.
Well now let's get right to it.
We set the default degree to 10 degrees.
Now scroll down to set the method on the bottom.
We defined the clockwise method with the degree set to default degree.
We set to return the same command with F string C W and degree set in the curly braces.
Copy and paste these two rows to create the counter clockwise method.
We set the counter clockwise method.
The degree will be set to the default.
Rewrite the command name to CCW.
Now let's add in commands to rotate the drone.
I'm going to delete the speed setting and rewrite the forward command to rotate clockwise 90 degrees.
We can also set to rotate counterclockwise 90 degrees.
Now I'll delete some commands to make the code more simple.
Once you're done with the script you can start running it to see how your drone works as we run the
code.
You can see the drone take off and hover for 10 seconds.
If we set a command without this 10 seconds sleep time sometimes the drone doesn't correctly receive
the commands so it's safer to set the sleep time to 10 seconds.
Here you can see the drone rotate clockwise 90 degrees.
Now you see it rotate back counterclockwise 90 degrees.
Then the drone lands and finishes the process.
We've completed the rotations now let's go back to the document.
We've just finished using the CW and CCW command after going through a couple of the commands.
I think you understand how this document works.
The next command will be flip by setting F.
The drone will flip forward be for flipping backwards r for right and L for left before we go to the
next lesson.
I want you to try and set the flip methods.
Think that if it's a small homework for you.
We've already set a lot of methods so I think you will do just fine once you finish the homework.
You can go on to the next lesson and see how you did.
This is a great practice for you to look into the SDK and think on how you can complete the code on
your own.
In this video you will see the drone flipping.
The flip is quite intense.
So make sure you have plenty of space when you flip your drone.
Also make sure the drone doesn't hit anything or even hit you.
Remember to set the drone in a safe place.
Now good luck with your homework.