Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cotestatnt authored Jun 22, 2020
1 parent f54872f commit 7a857ab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@ To update the states, you must frequently call the Update() function in your loo

If any of the transitions associated with the current state satisfy the trigger condition, the machine goes into the next state defined in transition property.

![SFC example](/SFC_esempio.png)

Each of the states of the machine can be associated with a callback function that will be executed when the state is activated (on entering), when it is left (on leaving) and while it is running (on state). For each status it is also possible to define a maximum duration time, at the end of which a timeout bit will be setted and can be tested with GetTimeout().

To configure the machine according to your needs, define the states (better if you create enumerations for states and for triggers in order to make the usage and layout of FSM clearer) and the configure correctly the transitions between each state.
In the main loop call update() metod and that's it.

Take a look at the examples provided in the [examples folder](https://github.com/cotestatnt/YA_FSM/tree/master/examples).
Start from the simplest Blinky https://github.com/cotestatnt/YA_FSM/blob/master/examples/Blinky/Blinky.ino

or a more advanced like classic algorithm for opening an automatic gate (simplified)
https://github.com/cotestatnt/YA_FSM/blob/master/examples/AutomaticGate/AutomaticGate.ino

![Automatic Gate](/esempio_cancello1.png)



Expand Down Expand Up @@ -73,4 +75,4 @@ The library works virtually with every boards supported by Arduino framework (no



+ 1.0.0 Initial version
+ 1.0.0 Initial version

0 comments on commit 7a857ab

Please sign in to comment.