Skip to main content

Getting Started


Getting Started

DUELink is here to help you no matter if you are an engineer building a commercial product, a maker doing-it-yourself, or an educator molding a learner's future.

There are many ways to use DUELink, with its long list of supported languages and hardware options. This page will focus on the bare minimum to get you started with one of the available DUELink microcomputers, such as the ultra-low-cost CincoBit and its cousin PixoBit.

CincoBit and Pixobit

The Arduino-friendly DueDuino is another example.

DueDuino


Online Demo

The fastest way to try DUELink is though this Online Demo, which uses JavaScript through a web browser to run some of the DUELink Standard Library commands.

DUELink Demo website

While all DUELink modules support the USB Interface, some boards have a USB connector built in. Other boards have a standard Uplink connector and require a USB adaptor such as USB Hook.

Here is a DueDuino example, which has a USB connector built-in, vs an LED module that is connected to USB through a USB Hook.

DUELink Connection

Start by plugging in your device to a USB port, open the demo site and connect the device.

Demo Connect

The first tab is for controlling the STAT LED. This is an LED that is found on all DUELink modules. Change the parameters and observe the STAT LED on the board.

Demo LED tab

If you are using a board with A or LDR buttons, you can also try Digital read on these buttons. These buttons are connected to pin 20. You will need to set Pull to Up. You can now hold the button up or down while clicking Read.

Read Button

By the way, when connected, the demo site shows the device ID and its firmware version.

Device Firmware


Firmware Update

The DUELink Console is a useful online platform to handle many important tasks, such as firmware update and scripting. It is fully covered in details here.

When you receive and new module, it is important that your board is using latest firmware. We will use the Console to check the firmware version, and update if necessary.

Plug in your device and "connect" it.

Console Connect

The console will show the current version loaded on the module and also the latest available version.

Console About

tip

The Release Notes lists the changes.

To update the firmware, open DUELink console https://console.duelink.com/ and click Firmware.

Firmware

Follow the instructions and load the latest firmware. Full details are found on the loader page.


Demo Scripts

The console includes a few simple scripts. Give some a try for an easy start with zero setup! These examples utilize the Internal Engine's built-in scripting language.

Demos

An example script would be a single line that controls the status LED (STAT LED). This LED is found on every single DUELink module.

# Blinks Status LED High for 200ms, Low for 200ms, repeat 50 times
StatLed(200,200,50)

Record and run your script then observe the LED. Try changing the numbers to change the LED behavior.

Status LED

See the Console page for full details.


Hello World

Now, you are ready to use one of the languages, such as Python or JavaScript. These are just some of the available Coding Language options. There are standalone options as well. These pages include full instructions on how to load programs but here is a small example that shows what a full program looks like. It uses the StatLed().

You need ot install the DUELink Python library using pip install DUELink, see Python page for details.

from DUELink.DUELinkController import DUELinkController
import time

# Connect
availablePort = DUELinkController.GetConnectionPort()
duelink = DUELinkController(availablePort)

# Blink
duelink.System.StatLed(200,200,50)

This is another example that controls the STAT LED directly using digital write. Note that the STAT LED is always pin 0. This program runs an infinite loop. Stopping the program will stop the LED from blinking.

from DUELink.DUELinkController import DUELinkController
import time

availablePort = DUELinkController.GetConnectionPort()
duelink = DUELinkController(availablePort)

while True:
duelink.Digital.Write(0, 1)
time.sleep(0.5)
duelink.Digital.Write(0, 0)
time.sleep(0.5)