This section targets the two following objectives:

  • O1: Illustrate how to abstract code into models;
  • O2: Identify how to operationalize models according to different targets (e.g., ease of development, intended users)

Here we choose a subdomain of reactive systems, namely, programming a micro-controller reacting to tiny sensors and operating on actuators. However, the modeling and code issues that arise from this simplified case are representative and a good abstraction of the real one.

The first three steps of this section illustrate different levels of abstractions one can use while programming an Arduino-based reactive system. From these stages, we start discussions about tools and methods to gain abstraction in a piece of code (O1) and also the pros and the cons of the different approaches according to many criteria (e.g., expressivity, facilities to extend, maintain, debug, identity of the end-user), targeting O2.

Start here:

Implementing plain old C code

Using the arduino library

Programming a finite state machine

Modelling a finite state machine

Modelling an arduino app