We have previously introduced the graphical programming method using MakeCode. By using the graphical method, you can easily and quickly write programs. Through extensions (libraries), it is also very easy to drive sensors and peripherals.
Although the graphical method is simple, it is more convenient to use code programming for slightly more complex programs. For example, if there are dozens of data to be input, the graphical method not only takes up a lot of space, but also has many input steps and is prone to errors; the code method is much more convenient.
MakeCode supports both graphical (block) programming and code programming.
Click on the javascript icon in the middle of the programming interface to switch to code mode.
Interface after switching
The code mode uses the typescript language, which is very easy for users familiar with JavaScript and not difficult for most engineers who use C language. The graphical mode can be directly switched to the code mode, but the code mode may not be able to switch back to the graphical mode, because some code functions are not supported by the graphical mode. For unfamiliar functions, you can start with graphical programming. After switching to the code mode, the corresponding statements will be automatically generated, which can help you learn code programming.
This content is originally created by dcexpert , a user of EEWORLD forum. If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source