if command with no comparison
TJHJ
Posts: 243
So I was looking at the TSL230 light to frequency driver, and for the auto scaling part, in which it changes the state of two pins to determine the scale.
The command call, places a true or false in auto.·
So it then evaluates the following
changing which pins are high/low to set the scale. So where I am lost is in the if evaluation. I just had it in my mind a if statement it must be followed by a evaluation.
I am guessing that if auto == true it performs the evaluation?
False does nothing, leaving the two output pins as they were previously set.·I just wanted to make sure this is correct?
The command call, places a true or false in auto.·
So it then evaluates the following
if auto 'autoscaling code if val > 1_000_000 'if output exceeds 1 MHz, decrease gain scale := --scale #> 1 elseif val < 10_000 'if output less than 10 kHz, increase gain scale := ++scale <# 3 outa := scale << cbase
changing which pins are high/low to set the scale. So where I am lost is in the if evaluation. I just had it in my mind a if statement it must be followed by a evaluation.
I am guessing that if auto == true it performs the evaluation?
False does nothing, leaving the two output pins as they were previously set.·I just wanted to make sure this is correct?
Comments
"if auto" is equivalent in behavior to "if auto <> 0"