Today we will take a detailed look at the process of drone programming. Let’s look at “programming” first.
Definition of “programming”
Design a “controllable system” with a logical flow. We can understand it like this: programming is a process. We write letters or numbers as a programming language. After inputting the programming language into the computer, let the computer execute specific functions according to the language. The task, this complete process is called programming. for example:
I came home from getting off work and my stomach was growling. Let’s fry the food quickly – heat the rice – eat it, this is a complete programming process! In this process, we go through: hungry-mouth wants to eat-cooking, three main steps. This is the programming of our human body, the process is as follows:
First, the hunger signal is transmitted from the stomach to our brain, which is the code that we computer workers enter.
Second, the brain processes input information, which is what our computers process code.
Third, we cook, and this is what our computer outputs.
The same is true of basic computer operations: input – processing – output, and that’s how programming works.
What about programming languages?
A formal language is used to define computer programs.
For example: For electric lights, there are only two operations to turn on and off. These two operations are actually power-on and power-off, which are the two most basic and bottom-level operations of all circuit systems. A computer is composed of a circuit system, and naturally, there are only two basic operations of power-on and power-off. Power-on is 1, and power-off is 0. 1 and 0, as the only two basic elements of a computer, constitute a computer language.
When we transmit commands to the computer, you can use 00 for left and 01 for right, but how about up and down?
There are thousands of human languages, and each word can be uniquely represented by a combination of 1 and 0, but the human brain cannot remember so many number strings with only 1 and 0. Therefore, smart computer giants have invented a programming language between human natural language and computer language.
For example, Python, C++, etc. Some gurus have found that it is too difficult for children to learn languages directly. We simply associate the fun building blocks with programming languages to make programming more interesting. So Scratch, a graphical programming language, came out.
Scratch is a programming language and an online community. Children can use it to learn to program and share with others their interactive media creations such as stories, games, and animations. It is a graphical programming language.
That is to say, it does not require users to memorize any keywords, does not require users to learn complex program structures, and does not require users to input complex text; users only need to drag and drop the blocks in Scratch according to a certain logical order module, you can build your own program. The programs mentioned here, as mentioned above, can be stories, games, animations, etc.
It is now the most popular graphical programming software in the world.
Scratch is suitable for kids who don’t have any programming background or even can’t type on a computer. I personally think kids around 5 years old can start learning Scratch. Of course, for children around 6-13 years old, or even adults, it is no problem to use Scratch as an introduction to programming. The graphical programming interface greatly reduces children’s fear of programming.
For kids over ten years old who want to learn “real” programming, Python is a very good programming language choice. Python is a very popular general-purpose high-level programming language in the current computer industry. It is a powerful tool for data processing, natural language processing, and machine learning in many industries. It can also be used to build websites and various applications. Although Python is very powerful, it is not complicated to learn because of its simple syntax, strong readability, and large developer community. Therefore, Python is also particularly suitable as the first language choice for learning programming.
When little kids get tired of Scratch’s limitations, Python is one of the best options for their next programming learning.
Finally, the higher-level language is the C++ language, an object-oriented programming language developed on the basis of C language, which is widely used. Commonly used in system development, engine development, and other application fields, suitable for college students.
drone programming process
The most important thing for a drone is its four axes, the propellers that provide balance in the air. Each propeller is driven by a motor. The four-shaft propeller will generate lift depending on the state of the motor. The combination of these lift forces allows the drone to hover, roll, pitch, and yaw in the air.
In the flight, the data of its own attitude needs to be obtained, mainly through the gyroscope sensor, the acceleration sensor, the magnetic field sensor, and the atmospheric pressure sensor to obtain the data source.
These data sources can be read into the graphical programming interface, and then by controlling these data sources, the flight attitude can be changed to realize a series of programming actions.
Why learn drone programming?
Some people say that letting children learn programming is to let them become programmers. In fact, it is not (we learn words, not just to be called writers?, but to learn logical thinking, so that in the future life Available ways of thinking. This way of thinking will allow you to gradually understand how to break down a complex problem into relatively simple separate parts, and then solve each small problem in a certain order, combine each answer, and finally complete the whole problem.