I've recently resurected a piece of hardware that uses a picaxe 08m2 to read a light sensor before and after an external operation, place those 2 values into variables b1 and b2, and compare. I'ts supposed to check that a) the second reading (b2) is lower than the first, and that the first reading was at least 1.55 x the second. I didn't write any notes with the code, so I'm baffled as to how this part of it is supposed to work. I'm sure it did used to work, but now it doesn't give the expected results.
b3=b1/b2
b4=b1*100/b2//100
if b3 > 0 and b4 > 55 then
etc..
Is this how the picaxe precesses the 2nd line, If b1 = 221 and b2 = 46?
b4 = b1 x 100/b2//100
b4 = 22100/46//100
b4 = 480.4347826//100
b4 = 0.8043478
In which case I must have misunderstood how this is processed, because sometimes it does decide to execute the rest of the code as if b4 was >55.
Thanks anyone who can help
b3=b1/b2
b4=b1*100/b2//100
if b3 > 0 and b4 > 55 then
etc..
Is this how the picaxe precesses the 2nd line, If b1 = 221 and b2 = 46?
b4 = b1 x 100/b2//100
b4 = 22100/46//100
b4 = 480.4347826//100
b4 = 0.8043478
In which case I must have misunderstood how this is processed, because sometimes it does decide to execute the rest of the code as if b4 was >55.
Thanks anyone who can help