The previous introduces how to create directory, and how to create and save files in the directory. This section will introduce how to edit and execute the program.
P.s. Please ensure the development board is connected to PC at here (please refers to 2.3.1 Firmware&Configuration for details).

2.3.3.1 Edit Code

Create(please refers to 2.3.2 for details) and name a new file (e.g. test.py). Then you can edit code in the Code Edit.
Besides, there are many commands in the menu Edit, such as Copy, Cut, Paste, Redo, Undo, Find, Replace and so on. According to these commands, you can operate the edit contents more easily. The shortcut keys and quick-start icons has the same effects, shown as below.

2.3.3.2 Syntax Check

Click quick-start icon after completing code edit can check program syntax (NOTE: Logic check is not concluded), then printing information could be seen in the terminal. If the program syntax is alright, it will print “syntax finish”; If syntax errors exist, error information will be printed, shown as below.

2.3.3.3 Program Execution

To download files for the development board, there are two types of files, one is the library files that do not need to be executed, and the other is the files that need to be executed. So we implement three separate functions: download, execute, download and execute.

Download the current file to the developing board
Please open file in the code edit, select a menu option Tools→Download.

Or, you can drag file to the device directory.

Run the developing board file

Select file to run in the device directory, right-click the mouth to select run.

Download and Run

Select a menu option Tools→DownloadAndRun (shortcut key: F5/click quick-start file-saving icon ).

NOTE: If you want to run a file when the Code Edit opens more than one files, click the file label first and download to run.

Stop Execution

Select a menu option Tools→Stop (or click quick-start file-saving icon ) to stop the executing program.
Now we have already learned how to edit and execute programs in uPyCraft. The next section will introduce how to use uPyCraft IDE built-in examples.

results matching ""

    No results matching ""