Check and correct based of sensor many sensors- logic structure

@jjlee32,

I have been working on similar projects for some time. I started with a “nested if” approach but have been moving to a finite state machine approach. My journey to this approach is extensively documented on this thread starting with a suggestion from @peekay123. A more net version of this can be found here thanks to @gusgonnet

the thing I like about this approach is that before you start writing code, you need to think about what you want the program to do and lay out the flow in a visual state diagram. Once you have this, writing the code is more straightforward as you are simply writing the code for each unique and well defined state and its assigned outcomes.

I hope this is helpful.

Chip

3 Likes