Understanding TotalCross for Linux ARM

TotalCross now supports embedded systems!

Introduction

See at this guide:

  • Discover plugin for VS Code;

  • Getting your Hello World App cooler;

  • How to deploy;

  • After basics;

Requirements

Complete the Getting Started:

Getting Started

The following electronic components are also required:

  • Raspberry Pi 3;

  • 7x jumpers male-female;

  • Protoboard;

  • LED RGB module (or common 4 pins LED RGB);

  • Push-button module (or common push-button).

In order to execute Gpiod methods at your embedded device, you will also need to have the libgpiod-dev package installed in your board. You can do that by entering the following command at the device's terminal:

Guide

Discover VS Code plugin

A quick way to start using TotalCross is installing the TotalCross extension for VS Code.

Step 1: open VS Code console (CTRL + Shift + P) and type TotalC… autocomplete should help!

Step 2: select TotalCross: Create new Project;

Step 3: create a folder called HelloWorld and select it;

Step 4: GroupId will be com.totalcross;

Step 5: ArtifactId will be HelloWorld;

Step 6: select the latest version of TotalCross SDK and -linux-arm platform;

Click to expand

Step 7: openRunHelloWorldApplication.java and click Run (IDE). The result should be:

Click to expand

Step 8: watch the integrated simulator!

Getting your Hello World App even more Cooler 🥶 😅

The following project deals with the control of an RGB LED with user interface buttons and a pin reset button!

Step 1: follow the schematic:

Step 2: to work with pin logic after public class HelloWorld extends MainWindow { add:

Step 3: at HelloWorld.java in initUI() code add:

Step 4: then, board setup:

Step 5: pins setup:

Step 6: the red button:

Step 7: and the other buttons:

Step 8: finally we use a thread to check the state of the reset button:

Step 9: run RunHelloWorldApplication.java again and watch the results!

View fully code here

How to deploy

Step 1: open VS Code console (CTRL + Shift + P) and select TotalCross: Deploy

Step 2: a second dialog box will appear and just fill in the board's information:

Step 3: see the results in screen or VNC

After basics

This was the beginning of application development for TotalCross embedded systems, how about taking a look at TCSample and seeing all that can be done? See dashboard made especially for Web Summit 2019:

See more

Are you interested in development with embedded systems? Contact us via Telegram!

Bruno Muniz, Lucas Galvanini e Pedro Lyra no WebSummit

References

Last updated

Was this helpful?