Edit on GitHub

Digital Watch (C++) for Arduino

This digital watch was first designed by Harel, the founder of the Statecharts Theory. He described it in "On Visual Formalisms", published in "Communications of the ACM" in May 1988. The details of the example can be found in the platform independent example. This example focus on the integration on a Arduino combined with a 16x2 LCD Shield.

The digital watch statechart in all its details

Addons for compiling and flashing

For compiling and flashing the Eclipse C++ IDE for Arduino plugin has been used. This can be found at 'https://marketplace.eclipse.org/content/eclipse-c-ide-arduino'. Please ensure that you have installed the Arduino toolchain. This can easily be done by installing the Arduino IDE, which can be found here: 'https://www.arduino.cc/en/Main/Software'. It is not possible to compile code with the Eclipse C++ IDE for Arduino plugin without an installed toolchain!

How to install the Eclipse C++ IDE for Arduino plugin

The easiest way is to use the example wizard. Required dependencies will be recoginized automatically and can be installed by clicking the "Install Dependencies.." button on the top right. Just follow the installation instructions.

After the installation of the plugin: Ensure that you have downloaded the 'Arduino AVR Boards'. You need to add them via 'Help' -> 'Arduino Downloads Manager' -> 'Platforms' -> 'Add'. For this example you also need the 'LiquidCrystal' library, which can be found using the search bar.

Using the Eclipse C++ IDE for Arduino plugin

After the installation you should notice a new toolbar, which allows you to compile and flash your Arduino.
  1. First of all, your project should contain no errors any more.
  2. To get started you need to configure the desired platform. Choose your personal settings and board. Most of the Arduinos (Uno, Mega, etc.) should be supported. Plug in your Arduino and click on 'New Launch Target..'.
  3. Set up your device. This depends on your system and configuration.
  4. Build project.
  5. Upload the example.
  6. The digital watch should be displayed on the LCD!
Download examples

Drag to install

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

Back to overview