Learn

Courses, teaching materials and example diagrams for learning hierarchical state machine programming.

Courses

Educational materials on HSM programming can be found at the National Cyber-physical Platform portal (Russian).

Introduction to state machine programming for Arduino

A course for beginners (in Russian): eight lessons, 16 academic hours; every lesson has theory and practice. The authors are Alexey Fedoseev, Anita Khodova and Gleb Chekmarev.

  1. Introduction to digital electronics and microcontrollers
  2. State machines controlling a traffic light on Arduino
  3. Basics of state machine programming: states and events in a program
  4. The state machine programming language (HSM) for real devices
  5. Control with sensors: analog and digital ports
  6. The microcontroller inside. C++ for programming microcontrollers
  7. Programming Arduino in C++. Generating code from state machines
  8. Controlling external devices: motors and relays

The practice runs on Arduino Uno with LEDs, buttons, sensors, a relay and a servo; an online simulator can stand in for the hardware. The diagrams are drawn in Cyberiada IDE and CyberiadaPro.

Online courses

Teaching materials

Examples

ExamplesWhere
the diagrams of the Arduino coursehsm-arduino-course/diagrams
Arduino and the TJC-HSM boardslapki-compiler/examples
finite automata: Morse code, parity, an e-mail addressfa-dispatcher-py/examples
ROS 2 robots: the turtle, a maze solverhsm_robot_ros_generator/examples
the figures of the standardcyberiadaml-compat-tests/docs/diagrams