Cyber-Physical Systems (CPS) are systems creating connection between the real physical world and the digital world with a wide scale of sensors. Usually communication is realized through embedded systems. One of the most popular embedded system is the Arduino, because it is cheap, well supported and there are lots of hardware and sensor components for this platform.
CPS systems mainly use model-based implementation: the behaviour of these systems are defined with high level state-based models then these models are used to automatically generate the program code. One of the most popular state-driven formalisms are the statecharts, which enable to describe different behaviours in a compact way.
The spread of the CPS systems increased the need of code generators that build executable source code for embedded systems from the state-based models. In my work I developed a code generation process that derives Arduino source code from statecharts.
The main point of my work is to create syntactically and semantically correct source code based on the statechart model, the used devices and the circuit diagram. The result is the fact that the end user does not need any kind of programming language knowledge or embedded system experience.
In order to accomplish my work, I used the YAKINDU software to create statecharts. The YAKINDU is well supported and easy-to-use, moreover, it has an external plugin, which can generate source code “shell” from the state-driven model. All in all, it is an optimal base for my code generator implementation.
The YAKINDU software uses the Eclipse platform. I wanted to create a standardized solution, so I decided to use Eclipse IDE for Java Developers and the EMF plugin, which is also an Eclipse platform extension.
I demonstrate my solution on case studies.