1
00:00:00,450 --> 00:00:07,610
In this lesson we will be setting the drone to rotate clockwise and counterclockwise command name C

2
00:00:07,640 --> 00:00:14,750
W stands for clockwise and we can set the x 2 1 to 360 degrees.

3
00:00:14,790 --> 00:00:21,810
This is the same for counterclockwise which will be CCW for the command name.

4
00:00:21,840 --> 00:00:23,890
Well now let's get right to it.

5
00:00:23,910 --> 00:00:26,700
We set the default degree to 10 degrees.

6
00:00:26,760 --> 00:00:30,280
Now scroll down to set the method on the bottom.

7
00:00:30,360 --> 00:00:35,300
We defined the clockwise method with the degree set to default degree.

8
00:00:35,520 --> 00:00:43,070
We set to return the same command with F string C W and degree set in the curly braces.

9
00:00:43,080 --> 00:00:47,580
Copy and paste these two rows to create the counter clockwise method.

10
00:00:47,580 --> 00:00:50,070
We set the counter clockwise method.

11
00:00:50,070 --> 00:00:52,980
The degree will be set to the default.

12
00:00:52,980 --> 00:00:56,310
Rewrite the command name to CCW.

13
00:00:56,310 --> 00:00:59,130
Now let's add in commands to rotate the drone.

14
00:01:00,120 --> 00:01:07,050
I'm going to delete the speed setting and rewrite the forward command to rotate clockwise 90 degrees.

15
00:01:07,050 --> 00:01:11,440
We can also set to rotate counterclockwise 90 degrees.

16
00:01:11,640 --> 00:01:14,990
Now I'll delete some commands to make the code more simple.

17
00:01:15,570 --> 00:01:21,150
Once you're done with the script you can start running it to see how your drone works as we run the

18
00:01:21,150 --> 00:01:21,870
code.

19
00:01:21,870 --> 00:01:25,480
You can see the drone take off and hover for 10 seconds.

20
00:01:25,530 --> 00:01:31,020
If we set a command without this 10 seconds sleep time sometimes the drone doesn't correctly receive

21
00:01:31,020 --> 00:01:35,720
the commands so it's safer to set the sleep time to 10 seconds.

22
00:01:35,790 --> 00:01:40,690
Here you can see the drone rotate clockwise 90 degrees.

23
00:01:40,770 --> 00:01:44,580
Now you see it rotate back counterclockwise 90 degrees.

24
00:01:44,730 --> 00:01:48,310
Then the drone lands and finishes the process.

25
00:01:48,810 --> 00:01:55,100
We've completed the rotations now let's go back to the document.

26
00:01:55,280 --> 00:02:02,480
We've just finished using the CW and CCW command after going through a couple of the commands.

27
00:02:02,510 --> 00:02:05,360
I think you understand how this document works.

28
00:02:05,450 --> 00:02:09,310
The next command will be flip by setting F.

29
00:02:09,350 --> 00:02:18,380
The drone will flip forward be for flipping backwards r for right and L for left before we go to the

30
00:02:18,380 --> 00:02:19,450
next lesson.

31
00:02:19,490 --> 00:02:23,570
I want you to try and set the flip methods.

32
00:02:23,930 --> 00:02:28,130
Think that if it's a small homework for you.

33
00:02:28,130 --> 00:02:34,370
We've already set a lot of methods so I think you will do just fine once you finish the homework.

34
00:02:34,370 --> 00:02:37,930
You can go on to the next lesson and see how you did.

35
00:02:38,030 --> 00:02:43,580
This is a great practice for you to look into the SDK and think on how you can complete the code on

36
00:02:43,580 --> 00:02:45,230
your own.

37
00:02:45,230 --> 00:02:48,590
In this video you will see the drone flipping.

38
00:02:48,590 --> 00:02:50,080
The flip is quite intense.

39
00:02:50,090 --> 00:02:54,030
So make sure you have plenty of space when you flip your drone.

40
00:02:54,050 --> 00:02:58,620
Also make sure the drone doesn't hit anything or even hit you.

41
00:02:58,700 --> 00:03:01,800
Remember to set the drone in a safe place.

42
00:03:02,210 --> 00:03:03,680
Now good luck with your homework.
