Skip to content

Arduino - Integration Guide using Polling (C)

Embedded Systems Integration Guide - Arduino with @CycleBased or @EventDriven execution using Polling.

This example has been created to illustrate how an Arduino can be programmed using @CycleBased or @EventDriven execution and polling. You can find a detailed description in our documentation.

The state machine

The state machine contains the following parts:

  • Two regular states
  • One final state
  • Two incoming events
  • Two outgoing events
  • One timed event
The main idea is to use every component, which has an effect on the integration of the state machine code. A detailed description can be found in our documentation.

The statechart

Addons for compiling and flashing

All Arduino examples can be compiled via command line or be imported into the Arduino IDE. An easier way is using the Sloeber plugin , which allows you to compile and upload the code directly in Statechart Tools.

How to install the Sloeber plugin

There are two ways of how to install the plugin. The easiest way is using our example wizard, which allows you installing required plugins. Just follow the built-in instructions.

Another way is installing the plugin manually. You need to follow these steps:

  1. Click on 'Help' -> 'Install New Software..' -> 'Add...'.
  2. Define a name and add '' as location.
  3. Choose the plugin - not the IDE.
  4. Follow the instructions
  5. The installation dialog will ask you for a restart. After this restart is done, the installition it will download some files. Just wait until it's finished

Configure the Sloeber plugin

After the installation you should notice a new Toolbar, which allows you to compile and flash your Arduino. Initially, the projects are not configured, as you may require to add the toolchain:

  1. Click on Window -> Preferences
  2. Open the Arduino window -> Platforms and Boards
  3. Depending on your Arduino, choose the board. For the UNO click on arduino -> Arduino AVR -> check out one toolchain
  4. Click on Apply and Close and wait until the downlaod has been finished
Some examples may need different libraries. E.g. the LiquidCrystal lib. If so, repeat the steps using the Library Manager and add your required lib.

Configure the example

Once you have installed the toolchain for your Arduino, you can configure the project.
  1. Right click the project and open the Preference page
  2. Open the Arduino window
  3. Choose your platform and port
There will be a dialog, which warns you that the platform.txt is missing. This is not a problem and will be resolved after the intitial configuration.

Compile and upload

Finally, you can use the green toolbar for compiling and flashing the Arduino. Have fun!

Download examples

Drag to install

Drag to your running itemis CREATE (min. version 2.8.0) workspace.

Back to overview