Learning goals

After following this tutorial, you will be able to:

  • Integrate every kind of event type in Dezyne with handwritten (hereafter native) code

  • Navigate through the essential areas of generated code

  • Create a native environment for the generated code to run in

  • Understand what the Dezyne runtime is and how it should be used within your own application

  • Compile an application consisting of native and generated code (in C++)

Intended audience and prerequisites

This tutorial assumes that you are familiar with the basics of the Dezyne modeling language and have some affinity with C++, Linux and the Raspberry Pi. It is assumed you are somewhat familiar with software designed from an event-based approach.

The examples shown throughout this tutorial will be using the Eclipse Dezyne plug-in, although Dezyne can also be used as a stand-alone command line client. It is assumed that you have a Dezyne-equipped Eclipse running on your system before starting this tutorial.

Throughout the tutorial, we will be using various iterations of the Alarm System that can be found in the Dezyne introductory tutorial. Where applicable, a starting point of Dezyne models required for a step in the tutorial will be provided on Github.

Furthermore, throughout the tutorial you will find references to lambda expressions and polymorphism/inheritance in C++. If you are unfamiliar with these concepts, you may find the following resources useful:

Platform choice

This tutorial will target the Raspberry Pi as hardware platform. The Pi can run a Linux distribution that is compatible with C++11 features that are used by generated C++ Dezyne code. With some extra components, it is also capable of driving some basic GPIO. The Raspberry Pi that was used to create this tutorial is a Raspberry Pi Model 2 B running Raspbian 8 (Jessie). The g++ version of the Raspberry Pi is 4.9.2.

The components used are as follows:



Raspberry Pi




220 Ohm resistor


Hardware button




It is, of course, not absolutely necessary to build an actual system that performs all of the tasks. You could also just write stubs for the hardware that will be called upon and run the application on your own system. During the tutorial we will consider actual hardware implementations, but most of the information will still apply if you are using stubs.