01-15-2024 10:31 AM
Hi,
I am trying to implement a state machine for my application. I have an initialize state where I initialize the input variable. I am trying to index the array elements one by one, for example index the element 0 and pass the value to the sensor, wait for 1s, then record or store the value to another array. But I was not able to index the array elements one by one, kindly suggest me some way in which I can do that.
01-15-2024 11:25 AM - edited 01-15-2024 11:30 AM
As a first step, I recommend to clean up the code a little bit.
Start with writing down all possible states, what should happen in them and what should cause state transitions as a function of time and user interactions. For testing I would eliminate the hardware interactions and replace the lower loop with a simple simulation instead. Makes testing much easier! I even doubt that you really need two parallel loops.
01-17-2024 03:19 AM
Thanks