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.
- Introduction to digital electronics and microcontrollers
- State machines controlling a traffic light on Arduino
- Basics of state machine programming: states and events in a program
- The state machine programming language (HSM) for real devices
- Control with sensors: analog and digital ports
- The microcontroller inside. C++ for programming microcontrollers
- Programming Arduino in C++. Generating code from state machines
- 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
- Programming autonomous systems with the Berloga: Apiary Defence game (in Russian)
- Programming an autonomous character in video games (in Russian)
Teaching materials
- Voevodin I. G., Voevodina A. I., Tsyrulnikov E. S., Shumak K. A. Fundamentals of event-driven programming and extended hierarchical state machine programming (in Russian). Moscow: Kruzhok Association, 2024.
- Cyberphysics Almanac, issue 1 (in Russian): the standard of the HSM programming language. Moscow: Kruzhok Association, 2025.
- Harel D. Statecharts: A visual formalism for complex systems. Science of Computer Programming, 8.3 (1987).
- Samek M. Practical UML Statecharts in C/C++. Newnes, 2008.
Examples
| Examples | Where |
|---|---|
| the diagrams of the Arduino course | hsm-arduino-course/diagrams |
| Arduino and the TJC-HSM boards | lapki-compiler/examples |
| finite automata: Morse code, parity, an e-mail address | fa-dispatcher-py/examples |
| ROS 2 robots: the turtle, a maze solver | hsm_robot_ros_generator/examples |
| the figures of the standard | cyberiadaml-compat-tests/docs/diagrams |