## 3 Results
### Case Study: Control of Laboratory Discrete Event System  
For demonstration purposes, a Petri net for control of a car wiper system was modeled using the proposed application. In modern cars, wipers are able to work in both manual and automatic modes. In manual mode, switching the wipers on and off is usually controlled by a lever or a button. When the wipers work in automatic mode, the car's control subsystem takes care of everything. Switching on, off, setting the wiper intensity according to the intensity of the rain is automatic and no intervention by the car driver is required. The only action required by the driver is to enable automatic mode. The proposed control system implements all mentioned requirements. The Petri net representing this system uses several functions supported by the PetriNet engine. These are mainly Arduino-associated places and transitions, time transitions, priority transitions, capacity places, and reset arcs. The Petri net is shown in Figure 10. The graphical representation of Petri net is standard, more information can be found e.g., in [29]. The double arrow is used for reset arcs. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \begin{tabular}{c} **Number of** \\ **Places** \\ \end{tabular} & \begin{tabular}{c} **Number of** \\ **Transitions** \\ \end{tabular} & \
\begin{tabular}{c} **Use of Memory without Optimisation** \\ **FLASH** \\ \end{tabular} &
\begin{tabular}{c} **Use of Memory with Optimisation** \\ **SRAM** \\ \end{tabular} \\ \hline \multirow{2}{*}{5} & \multirow{2}{*}{5} & \multirow{2}{*}{5} & 14 248 B & 1 904 B & 15 958 B & 518 B \\  & & (44 \%) & (92 \%) & (49 \%) & (25 \%) \\ \hline \multirow{2}{*}{8} & \multirow{2}{*}{8} & \multirow{2}{*}{8} & 15 286 B & 1 954 B & 17 314 B & 574 B \\  & & (47 \%) & (95 \%) & (53 \%) & (28 \%) \\ \hline \multirow{2}{*}{10} & \multirow{2}{*}{10} & 16 166 B & 2 040 B & 18 042 B & 606 B \\  & & (49 \%) & (99 \%) & (55 \%) & (29 \%) \\ \hline \multirow{2}{*}{15} & \multirow{2}{*}{15} & 17 748 B & 2 068 B & 19 94 B & 690 B \\  & & (55 \%) & (100 \%) & (61 \%) & (33 \%) \\ \hline \multirow{2}{*}{20} & \multirow{2}{*}{20} & 19 500 B & 2 152 B & 22 26 B & 782 B \\  & & (60 \%) & (105 \%) & (68 \%) & (38 \%) \\ \hline \multirow{2}{*}{40} & \multirow{2}{*}{40} & 26 688 B & 2 508 B & 29 730 B & 1 182 B \\  & & (82 \%) & (122 \%) & (92 \%) & (57 \%) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: _Cont._The capacities of places are:  
The priorities of transitions are:  
The system consists of three buttons--a button to start the automatic mode, to start the manual mode and to turn off the current mode. These buttons are represented by _AUTO_, _MANUIAL_, and _OFF transitions_. The next component of the system is the rain sensor. It is a simple analog device that changes the size of the output signal according to the size of the sensor area, which is damp or covered with water. The transition _rain_ \(S\) _trg_ is activated if the rain intensity is within 30% of the range of the rain sensor. If the rain intensity is higher, the transition _rain_ \(F\) _trg_ is activated. The servo motor that drives the wiper is represented by a place named _servo_. A place named _auto_ and a place named _manual_ are associated with an LED. The blue LED indicates the activated automatic mode and the red LED indicates the manual mode. The wiring diagram of the individual components with the Arduino Uno is shown in Figure 11.  
Figure 10: Petri net for control of laboratory car wiper system. After starting, the system is in an initial state, when it is possible to select automatic or manual mode by pressing the appropriate button. Depending on the selected mode, the corresponding LED lights up. By activating the _MANUAL_ transition, i.e., by pressing the red button, the token is moved from the place _guard_ to the place _manual_. The place _manual_ is associated with the Arduino pin where the red LED is connected, so this LED lights up.