Lesson 7. Block coding with a coding drone (1)




[Outline]


Coding drone supports not only unplugged coding but also plugged coding function.
Currently available pluggable coding programs are “Rockitbrick” and “Python”.
In this lecture, we are going to learn how to connect and code a coding drone and a rocket brick.

What is Plugged Coding?

Plugged means that an electric plug is plugged in.
Plugged coding refers to coding activities using electronic products such as computers and mobile devices.
One example of pluggable coding is block coding, which is a coding learning activity using an educational programming language (EPL).
You can create a program by arranging block-shaped commands in order by using a computer, tablet, etc. Representative educational programming languages include Rockitbrick, Entry, and Scratch.




[Connect]


1. Connecting the Coding Drone to Rockitbrick


Connect the coding drone to the Rockitbrick as follows.

1) What you need: PC, USB cable, coding drone, remote controller

2) Install the battery in the coding drone.

3) Connect the remote controller to the PC using a USB cable.

※ The drone and remote controller must be paired.





4) Program Download & Setup

Rokitbrick Download (Windows Version)
Rokitbrick Download (MAC OS Version)

5) Run Rockitbrick and click [SELECT]


6) [BRC-105] Click.


7) Click [Connect to Drone] and click the corresponding port to connect to the drone.


8) [Connection successful] If a message appears, the connection is normal.





[Note]


1. Rockitbrick Block for Coding Drone


1) Drone sensor block


- You can check the real-time measurement values of various sensors of the coding drone and use it as a variable block.

2) Remote Controller Button/Joystick (Lever) Judgment Block


- This is a block that determines the operation of the buttons and joystick (lever) of the remote controller and is used as a conditional in the conditional block.
-  You can generate a remote controller motion signal to perform a specific command.

3) drone flying block


- You can set the drone mode.
- Drones can take off/land and fly.

4) Drone/Remote Controller LED Block


- You can decorate the drone's LED in various colors.

5) Drone/Remote Controller Buzzer Block


- You can play the scale with the buzzer sound of the drone/controller.

6) Remote Controller Vibration Block


- You can turn the vibration of the remote controller on/off.


2. Precautions for use

1) lease use the drone with a fully charged battery, and if the battery level is less than 50%, flight performance may be affected.

2) Depending on the battery level and the condition of parts such as motors and propellers (motor performance, whether the propeller is defective, etc.), good or bad flight conditions may occur.

3) Drones and remote controllers always have the latest firmware installed.

4) The drone may malfunction due to program errors, so use it in a wide space as much as possible, and check that there are no people or obstacles around.


3. How to Force Stop the Drone


※ If an error occurs while using the coding drone in Rockitbrick or the drone does not fly in the desired direction, the drone must be stopped by force.


☞ If you click Force Stop on the running Rockitbrick screen with the mouse to end the execution, the drone will land directly from the current location.

☞ It is used to make and use a landing code so that it can land in an emergency on the Rockitbrick code. Make the drone land when a specific key on the keyboard is pressed. The code below is an example


- Press the space key to land the drone. “Flying motion state” is a block made to be used during coding by coding various motions of the coding drone.
flight mode
code
Ready
READY
Start
START
Take off
TAKE OFF
Flight
FLIGHT
Landing
LANDING
Stop
STOP


[Thinking of code]

If you succeed in connecting the coding drone to the rocket brick, shall we try a simple flight with block coding?
Let's try flying forward and then landing.


action sequence
① The drone takes off.
② Drone 1m Hover after moving forward.
③ The drone lands.


block
Explanation
The drone takes off. constant altitude (approx. 1m) And then it will hover.
The drone lands while in flight.
Wait for the motor to come to a complete stop after landing.
Do not use the landing command when the drone is too high or too low.
(1m The height is appropriate.)
The drone will fly by default according to the settings of the following options.
※ Basic flight: Advance, junior, move left, move right, Increase, descent
option One
Sets the default flight direction.
① forward = move forward
② backward = move backward
③ Left = move left
④ Right = move right
⑤ up = move up
⑥ down = move down
option 2
Set the movement speed.
(unit: m/s, decimal point available)
option 3
Set the flight distance.
Street = speed x time ex) 1m/s * 1sec = 1m
(unit: seconds,decimal point available)


Now, how to write code using the above blocks Think about what it will be I thought of the code like this:


code
action sequence
Takeoff → Wait 5 seconds (= hovering) → Move forward 1m → Landing


Use the wait command between takeoff and move commands to give the drone time to position and maintain a stable posture after moving.




[Coding and running]


1. Coding


Let's make code by assembling blocks in Rockitbrick.


2. Running


When you have created all the code, press the space bar to run it.
Before executing, first check the following:

a while! Check it out one more time before running the drone autonomous flight code on Rockitbrick!

1) Secure a safe distance (2m or more) from the drone.
2) Make sure there are no people or obstacles around the drone.
☞ Make sure that there are no people or obstacles in the path by predicting the direction and distance of the drone's movement in the code.
3) Check how to forcefully stop the drone in case of a malfunction of the drone or a rocket brick error.


So, if you're ready, let's run it.
Do the drones fly in the order of movement?
If it doesn't fly as expected, check which part is wrong, correct it, and try again







[Organize]


In this lecture, I learned about plug coding, a new coding function of the coding drone, and also tried block coding myself using Entry.
In Rockitbrick, you can do more diverse and higher-level coding than card coding.
Let's immerse ourselves in the fun of autonomous flight by coding using various blocks of the coding drone!

1) Plugged means that an electric plug is plugged in. Plugged coding refers to coding activities using electronic products such as computers and mobile devices.
2) Block coding is a coding learning activity using an Educational Programming Language (EPL) as an example of Plugged Coding.
☞ Educational programming languages: Rockitbrick, Entry, Scratch, etc
3)Coding drone and rocket brick connection method is PC and the controller USB After connecting with a cable, run Rockit Brick to connect the coding drone and hardware.
4)The Rockitbrick block for the coding drone is a sensor, flight, LED, It is composed of various categories such as buzzer.
5)If an error occurs while using the coding drone in Rockitbrick or the drone does not fly in the desired direction, the drone must be stopped forcibly. The method is as follows.
(1) (1) If you click Force Stop on the running Rockitbrick screen with the mouse to end the execution, the drone will land directly from the current location.
(2) (2) It is used to make and use a landing code so that it can land in an emergency on the Rockitbrick code.
6)Before execute the autonomous flight with a coding drone in Rockitbrick, check the safety rules first.



Coding with a coding drone (English)

  1. Make friends with Coding Drone!
  2. Let's fly a coding drone
  3. I code cards with a coding drone (1)
  4. I code cards with a coding drone (2)
  5. I code cards with a coding drone (3)
  6. Motion coding with a coding drone
  7. Block coding with a coding drone(1)
  8. Block coding with a coding drone (2)

Modified : 2021.7.16