Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20599

BASCOM-AVR : using If statement with And statement : REPLY

$
0
0
Another option, at least for now, is to break the code into several steps, instead of using the compound instruction. [code:1:8e2e2502d3] dim Pwindow as byte 'Flag, could be a Bit variable . . . Pwindow = 0 'Clear the flag, Pressure is NOT inside the window If Pressure5 >= Plow then if Pressure5 <= Phigh 'Then are inside the window, so set the flag Pwindow = 1 'Set the Flag end if end if if Pwindow = 1 then 'Are inside the Pressure window, turn On the air cyclinders '... else 'Are outside the Pressure Window, turn off the air cyclinders .... end if . . . [/code:1:8e2e2502d3] Once it works, then make it concise and pretty, but first just make it work! Above is untested JC

Viewing all articles
Browse latest Browse all 20599

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>