NOTE: Read the article about the declaration part first.

In version 2 of the AFSM, the declaration can be done -for a great deal- by the configuration tool. Click here for this article. This article is for extra information.


The user configuration contains all variables needed for e.g. the I/O, timer and may also contain user setup declarations. This is the part for the user configuration. See also the declaration part on the website. There are 5 special areas in the UserConfiguration part: pins, tags, FSM states, User variabes and control variables.


In this part the definition of the pins is declared. For every I/O type, you have to declare the number of pins and the pin number to start with on the board. Keep the syntax of this part as it is; don't delete parts of the configuration you don't use.


For every defined pin, you have to declare a unique tagname. for example when declared 6 digital out pins; declare also 6 unique tags. This is important; the software is cheking the areas of the pins and the number of pins and tags.


Declaration of the Finite Machine unique states. Remember; Start and End are fixed states. Don't delete them form the list, the standard is always using these states.

User variables

In this area you can declare all the user variables for the particular sketch. In fact; you can put them everywhere, but this is an area specially made for finding your variables in an easy way.

Control variables

boolean UseI2C = false;
boolean UseHMISerial = true;
boolean UseGPS = true;
boolean UseInterCommunication = false;

Set these variables to true/false depending on the use of I2C,HMI user interface or a GPS. When "true" but actually not used, some code is executed for "Jan with the short last name" (that's dutch for "unnecessary").

In general; it is important the keep this set-up for this file. DON'T delete any part of the pin/tag part, otherwise the file will not compile/build.

Click here for an example of the declaration part.