BSNOS
Your first BSN Application, Hello World!
Let's start by creating the simplest BSN application possible, a blink application.
In the BSNOS IDE, create a new "BSNOS Java Project" by:
- Right click in the project explorer (or select the "File" menu).
- Select the "New" menu item followed by the "Project" menu item.

Expand the "BSNOS" project group and select "BSNOS Java Project Wizard", and press "Next".

Enter the project name "Blink", and press "Finish".

The project "Blink" will be created and it will be displayed in the "Project Explorer". If the project explorer is not visible on screen you can show it by selecting the "Window" menu, followed by "Show View" and then "Project Explorer".
Expand the "Blink" project to reveal its contents. Then expand the "src" tree element, and further expand the "(default package)" element to reveal the source code as depicted below:

The file "BSNOSAppMain.java" contains the main execution starting point. Open up this file by double-clicking on it. The starting execution point is defined by the annotation "@BSNOSStart()". Let's now add the source code which will toggle an LED and then sleep a while. We want the application to perform this action ad infinitum, so we'll wrap the LED toggling and sleeping in a "while loop". So, create a while true loop in the "main()" function as follows:
while (true) {
}
The BSN hardware functions are encapsulated inside the "BSN" Java class. Type "BSN" on the first line inside the while block, then press "CTRL" and hit the space bar at the same time. This will display the auto-complete feature as shown below:

The first suggestion in the auto-complete popup should be the BSN Java class (bsnos.platforms.bsn). Press "." since we want to access the class' functions to interact with the LEDs. The code to toggle LED number 0 followed by sleeping for 500 milliseconds is displayed below:
while (true) {
BSN.toggleLed( (byte) 0 );
BSN.waitMS( (short) 500 );
}
The "waitMS(short ms)" function is used to wait a number of milliseconds.
Since numeric literals are represented by integers by the Java compiler, the LED number must be typecasted to "byte" and similarly the milliseconds specified must be typecasted to "short".
If any errors exist in the code they will be underlined in red as show below:

If any errors exist, the "Problems" window can be displayed to further investigate the error. Display this window by selecting the "Window" menu followed by "Show View" and then "Problems". In the case above, the "waitMS" function was misspelt as "wajtMS".
Once, no errors are reported in the source we can compile the code to BSNOS bytecode by selecting the project we want to compile in the "Project Explorer" and then clicking "BSNOSCompile":

The "BSNOSCompileConsole" window will display compilation messages. A successful compilation will end with the text "Compilation Complete." as below:

Now, that the code is successfully compiling to BSNOS bytecode, we can program a BSN node. Ensure that the BSN USB board is connected and that a BSN main board is on the USB board. If you are plugging in the USB board for the first time you may be required to install the drivers for the board (auto-installation of the drivers may work as well).
To download the application to the BSN node first click the project that you would like to download, in this case the "Blink" project. Then select the COM port which the USB board is connected to, by clicking the "COM Port" dropdown arrow shown below:

Then press the "BSNOSDownloadApp" button which is next to the dropdown arrow.
The "BSNOSDownloadConsole" will display download messages. First BSNOS will be downloaded to the BSN node, followed by the application you have written. A successful download will look similar to below:

If the download was successful you should now see one of the LEDs on the main BSN board toggling!