Develop 86Duino Programs by 86Duino DOS SDK

The 86Duino DOS SDK is installed in the C:\86Duino directory by default. Under the C:\86Duino directory, there is the \example sub-directory where you can find the example.cpp sample code file, written in C++ different from the Arduino sketch.

Following is a sample code listing to blink an LED from the 86Duino Coding environment, which is fully compatible to the Arduino sketch environment:

void setup() {
  pinMode(13, OUTPUT);
}

void loop() {
  digitalWrite(13, HIGH); 
  delay(1000);
  digitalWrite(13, LOW);
  delay(1000);
}

To perform similar function under DuinOS, following is the modified version of the code from the above:

#include "Arduino.h"

int main(void)
{
  pinMode(13, OUTPUT);

  while(1)
  {
    digitalWrite(13, HIGH); 
    delay(1000);
    digitalWrite(13, LOW);
    delay(1000);	
  }		      

  return 0;
}

To develop application for DuinOS, you need to include the Arduino.h header file. The programming language syntax for the 86Duino DOS SDK development is the same as programming in C.

For DuinOS application that does not use any 3rd party libray, you can simply execute the make command under the C:\86Duino directory to compile and generate the 86Duino.exe executable, which you can launch by entering 86Duino.exe and press enter.

For DuinoOS application that uses 3rd party library, you need to add an entry for each of the 3rd party library to the Makefile, in order to link the 3rd library as part of the compilation process to generate the final executable.

The example.cpp sample code, mentioned earlier in this application note, uses the TimerOne 3rd party library. In the following section, we will talk about this example.cpp sample code and how to modify the Makefile.

Navigate to the \86Duino\example folder. Use Notepad or a text editor to open Makefile.

Locate the entry begin with THIRD_LIB_NAME, to the right of the := symbols, you can see TimerOne, the 3rd party library use by the example.cpp. When multiple 3rd party libraries are used, enter all 3rd party library to this line, with a space between each 3rd party library name.

sd_reader

For 3rd party library that requires other 3rd party library to function, include the other 3rd party library to the Makefile as above.

Library name Requires 3rd party library
TFT SPI
FreeIMU1 Wire
Adafruit_CC3000 SPI
SpiderL3S SPI
RF24 SPI
Mirf SPI
RadioHead SPI

Some 3rd party library files are not placed in the C:\86Duino\Libraries folder. You need to add entry for these 3rd party library to line begin with EXTEN_LIB :=

sd_reader

Following list the external library that is required for 86Duino DOS SDK:

Library name Compiler parameter for external library
Ethernet -lswsk
Rosserial86 -lswsk
USBHost -lalleg

Refer to the here for information about functions supported by the 86Duino DOS SDK.
Refer to the here for information about 3rd party libraries supported by the 86Duino DOS SDK.


Hacking

The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.