User Tools

Translations of this page:

Site Tools


en:first_program

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 Required software section. In section Development Environment download the latest version of NotePad++.
  • Unzip contents of the downloaded archive into the C:\ (Root Folder С:)
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.
  • Go to folder C:\Notepad++, and run the file notepad++.exe
  • At the root of the disk C create a folder Orbicraft_Test_Program
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.
Do not place the folder for saving files in the NotePad ++ folder
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.

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.

HelloWorld.c
#include <stdio.h>
 
void control(void){ 
 puts("hello, world!");
}
The first line includes the library necessary for working with the designer.
The program is written in C language.

• 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.

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.
You will see that the syntax of the program has begun to be highlighted in different colors, as in the picture below.

 Program syntax in NotePad++

  • Archive the program before downloading to the onboard computer Orbicraft. To do this, click on the icon archiving, it is located on the right in the menu bar.
After the archiving is complete, a window with a report on successful archiving should appear, as shown below.

 Archive Creation Report

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.
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.

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.

You can read more about cable connection in relevant section.

  • 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.
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.
  • 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.
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.

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_ProgramHelloWorld.zip) in the download area. In the comment field you must write the name of your program. Click the Submit button.

 Step 1

It will take time to load the program. Wait a couple of seconds. You will be automatically redirected to step 2.

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.

 Step 2

Wait a few seconds: the page will first refresh and show Step 1, and then automatically go to Step 3.

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.

 Step 3

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.

Step 4. Run the program
To run the program you need to click the button 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.

 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.

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.

 Remove a program

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.

 Remove all programs

en/first_program.txt · Last modified: 2018/10/12 15:26 by golikov