Marvee Amasi
DIIDevHeads IoT Integration Server
•Created by Marvee Amasi on 6/12/2024 in #middleware-and-os
How can I modify the state machine logic?
I'm working on this RTOS-based application for a vending machine controller with
C
and a state machine approach that manages various vending machine states as Idle
,CoinInserted
, SelectionMade
& Dispensing
, but
I'm encountering an error message in the console: StateMachine Error: Invalid transition from CoinInserted to Dispensing.
This occurs when a user inserts enough coins to trigger dispensing, but the selection hasn't been confirmed yet.
How can I modify the state machine logic to prevent this invalid transition and ensure a valid sequence of states Idle -> CoinInserted -> SelectionMade -> Dispensing
?3 replies