User Tools

Site Tools


en:first_program

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:first_program [2018/10/12 15:26] (current)
golikov created
Line 1: Line 1:
 +**Getting started with Orbicraft**\\ ​
 +**Writing and running the HelloWorld program**
 +
 +In this section, we will learn how to install the software needed to write programs for Orbicraft, write the simplest program and run it.\\ 
 +
 +This algorithm will be valid in the future when performing more complex tasks with Orbikraft.
 +
 +==== Step 1. Install the software ====
 +
 +  * Go to the [[software | Required software]] section. In section **Development Environment** download the latest version of NotePad++.
 +
 +  * Unzip  contents of the downloaded archive into the **C:\** (__Root Folder С:__)
 +
 +<note important>​
 +You can also install NotePad ++ in any other folder. It is important that the path to the folder and its name do not use special characters (! # @, Etc.), do not contain spaces and do not begin with a digit. </​note>​
 +
 +  * Go to folder **C:​\Notepad++**,​ and run the file **notepad++.exe**
 +
 +  * At the root of the disk **C** create a folder **Orbicraft_Test_Program**
 +
 +<note important>​
 +You can create a folder in another location. In fact, it is even more correct to keep the programs in the appropriate folders on your computer. It is important that the path of the folder and its name do not use special characters (! # @, Etc.), do not contain spaces and do not begin with a  digit.
 +</​note>​
 +
 +<note warning>
 +Do not place the folder for saving files in the NotePad ++ folder
 +</​note>​
 +
 +<note tip>
 +The NotePad ++ programming environment is intended for the user to write onboard software and to prepare it for loading on board. The environment is deployed and launched on an ordinary personal "​terrestrial"​ computer running Windows.
 +</​note>​
 +
 +==== Step 2. Programming ====
 +
 +You can program in the main NotePad ++ window. As the first test program, we will write the traditional program for outputting the greeting message “Hello, world!”. You can copy it from the field below.
 +
 +<file c HelloWorld.c>​
 +#include <​stdio.h>​
 +
 +void control(void){ ​
 + ​puts("​hello,​ world!"​);​
 +}
 +</​file>​
 +
 +<note tip>
 +The first line includes the library necessary for working with the designer. \\ The program is written in C language.
 +</​note>​
 +
 +• Save the file in the previously created folder **Orbicraft_Test_Program**.\\ ​
 +**File** –> **Save As** –> select folder (**C:\** - **Orbicraft_Test_Program**) –> enter file name (**HelloWorld**) –>​select file type (**C source file(*.c)**) –> click **Save**.
 +
 +<note important>​
 +It is important that, as in our example, the file name does not contain special characters (! # @, Etc.), does not contain spaces, and does not begin with a digit.
 +</​note>​
 +
 +<note tip>
 +You will see that the syntax of the program has begun to be highlighted in different colors, as in the picture below.
 +</​note>​
 +
 +{{ ru:​нотпад_1.png?​direct&​600 | Program syntax in NotePad++}}
 +
 +  * Archive the program before downloading to the onboard computer Orbicraft. To do this, click on the icon {{ru:​запуск_компиляции.png|archiving}},​ it is located on the right in the menu bar.
 +
 +<note tip>
 +After the archiving is complete, a window with a report on successful archiving should appear, as shown below.
 +</​note>​
 +
 +{{ ru:​отчет_о_сборке_архива.png?​direct&​200 | Archive Creation Report}}
 + 
 +<note important>​
 +If the archiving report ends with an error message (Zip Error), then try to verify the correctness of the above actions. Pay attention to the location and file names, which must be on latin, not contain special characters (! # @, Etc.), spaces or begin with a digit.
 +</​note>​
 +
 +<note tip>
 +In the folder Orbicraft_Test_Program an archive should appear with the name identical to the name of the program. Later we will upload it to the onboard computer of the Orbicraft.
 +</​note>​ 
 +
 +==== Step 3. Build and Run the Hardware ====
 +
 +  * Take 2 devices - **On-Board Control Computer (BCC)** and **Power Supply Unit (PSU)**.
 +
 + * Connect devices with a network cable. You can connect devices through any connectors.
 +
 +<note tip>
 +You can read more about cable connection ​ in [[[wiring | relevant section]].
 +</​note>​ 
 +
 +  * Press the red button to turn on the PSU. The voltmeter display and the green power indicator should light on. The voltage should not be lower than 7.4 V. If the voltage is lower, charge the PSU, using the charger.
 +
 +  * Wait 60 seconds, then check the Wi-Fi networks. There should be an Orbicraft Wi-Fi network. The default network name is **SCHSAT**. Connect to the network. Wait 10 seconds.
 +
 +<note important>​
 +The selected Wi-Fi network will have a “Connection limited” or “Without Internet access” mark. This is to be expected, since the Wi-Fi network created by the Orbicraft is not really intended for accessing the Internet, but is needed to control the Orbicraft.
 +</​note>​
 +
 +  * Open the browser. In the address bar enter the address **192.168.42.1**. In the user field enter **user1**, in the password field enter **user1** and click **Login**.
 +
 +<note tip>
 +You see the Orbicraft web interface. Using it, you can download programs to the onboard computer, go to the Wiki, and also make basic settings, such as changing the name of the Wi-Fi network that you may need in the future.
 +</​note>​
 +
 +==== Step 4. Launch the program ====
 +
 +For convenience,​ the instructions for working with the Web interface are duplicated in the Web interface itself.Several programs can be downloaded simultaneously to the BCC.
 +
 +To download and run the program, you must perform the following steps:
 +
 +**Step 1.** Download the archive\\ ​
 +Download the zip-archive created in NotePad ++.\\ 
 +(**C:\** - **Orbicraft_Test_Program** – **HelloWorld.zip**) in the download area. In the comment field __you must write the name of your program__. Click the **Submit** button.
 +
 +{{ ru:​шаг1.png?​direct&​400 | Step 1}} 
 +
 +<note important>​
 +It will take time to load the program. Wait a couple of seconds. You will be automatically redirected to step 2.
 +</​note>​
 +
 +**Step 2.** Select a downloaded task from the list\\ ​
 +Click on the link in the field “Task UUID” to activate the selected program. After this click, the program will be compiled. This may take some time.
 +
 +{{ ru:​шаг2.png?​direct&​500 | Step 2}}  ​
 +
 +<note important>​
 +Wait a few seconds: the page will first refresh and show Step 1, and then automatically go to Step 3.
 +</​note>​
 +
 +**Step 3.** Run the program\\ ​
 +In step 3, a link is displayed, click on it. A new browser window will open: here you can launch the program. ​
 +
 +{{ ru:​шаг3.png?​direct&​500 | Step 3}}  ​
 + 
 +<note important>​
 +The line above the link displays a brief report on the results of the compilation.
 +There may be error warnings that will be marked in red.
 +</​note>​
 +
 +**Step 4.** Run the program\\ ​
 +To run the program you need to click the button {{ru:​кнопка_запуска.png|Run the program}} in the opened browser page. The program will be completed (in our case, the greeting “hello, world!” will appear) and will end. A second click on the same button will run the program again; you can run it in one page an unlimited number of times.
 +
 +{{ ru:​работа_программы.png?​direct&​500 | Program execution}} ​  
 +
 +**Step 5.** Shutting down the program\\ ​
 +To end the program, you can simply close the browser page, return to **Step 2** to select another program that has already been downloaded, or to **Step 1** to load a new one.
 +
 +<note tip> ​
 +You can remove an unnecessary program from the list simply by clicking on the red cross in the field “Task UUID” next to the program selection link.
 +</​note> ​
 +
 +{{ ru:​удаление_программы.png?​direct&​400 | Remove a program}} ​  
 +
 +<note tip> ​
 +At the end of the web-interface page, it is possible to remove all downloaded programs at once by entering the ** CLEAN-ALL ** command in the line.
 +</​note> ​
 + 
 +{{ ru:​очистить_все.png?​direct&​400 | Remove all programs}} ​  
  
en/first_program.txt · Last modified: 2018/10/12 15:26 by golikov