Skip to content

Two versions of a screen showing depending on criteria value #2029

Answered by olikraus
ZivojinM asked this question in Q&A
Discussion options

You must be logged in to vote

You need to use a state machine, see for example here: https://www.embedded.com/implementing-finite-state-machines-in-embedded-systems/ or also here: https://www.embedded.com/programming-embedded-systems-the-easy-way-with-state-machines/

State machines are the key to solve your problems. Try to draw a suitable state diagram first, then implement the diagram by using the approaches mentioned in the above web pages.

Taking your above description, I assume you will have three states:

  • Intro Screen
  • GPS available
  • GPS no signal

Probably you will need to number your states, like this (the number itself is not important):

State Internal Number
Intro Screen 5
GPS available 10
GPS no si…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ZivojinM
Comment options

Answer selected by ZivojinM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants