Hi!
Help needed. I am making a project with a GPS module. I am using the time (clock). I want to set an output on or off in between some hours.
Is it possible in an if decision to make a command "if hour is between 3 and 8 then yes or no. So what I mean if a variable is in between two value.
Hope you understand-
Yhanks in advance
Br jorgen
In between decision!
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
-
- Valued Contributor
- Posts: 1189
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 439 times
- Contact:
Re: In between decision!
Lookup "Boolean logical operators" in C. The standard operators for examples && || work, and Flowcode helpfully converts 'and' and 'or' into the correct equivalent....
Note also that although parentheses () are not essential - care is needed as sometimes operator precedence can play tricks on you.. Brackets will keep things clearer and stop any surprises so I would recommend their use when combining terms.
Martin
Note also that although parentheses () are not essential - care is needed as sometimes operator precedence can play tricks on you.. Brackets will keep things clearer and stop any surprises so I would recommend their use when combining terms.
Martin