Edit on GitHub

Arduino - Integration Guide using Interrupts (C)

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

This example has been created to illustrate how an Arduino can be programmed using @CycleBased or @EventDriven execution and interrupts. 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

Installing the Arduino plugin

To compile the generated C code for Arduino, you should install an Eclipse plugin that can handle this and provides the needed libraries. This example uses the Sloeber plugin.

The easiest way to install the plugin is using the example wizard. Select this example, click on 'Install Dependencies...' and follow the instructions. Your IDE will restart and download the necessary Arduino libraries for you. Ensure that the installation has been completed before taking the next steps. You'll get a hint of the installation progress on the bottom right of your IDE.

Another way is using the update site, which can be found at http://eclipse.baeyens.it/. In YAKINDU Statechart Tools, simply install it by selecting Help → Install New Software in the main menu, typing or pasting http://eclipse.baeyens.it/update/V4/stable into the proper field, and follow the regular procedure.

Setup the example

After the installation the example will not compile, as no port and board has been selected yet. Right click the project, open the 'Properties' page and open the Arduino tab. As there was no platform selected before and the platform file was missing, an error will occur. Just click on 'Ok'. Select the platform folder, choose the board and select your port. That's it. The project is ready to compile and flash.
Download examples

Drag to install

Drag to your running YAKINDU Statechart Tools (min. version 2.8.0) workspace.

Back to overview