Sorry we missed this question
16 months is still not that bad for an answer
This code is a suitable example
Get SensorRegister 8
Subtract Counter001
If LastActionValue <128 Then
Do IR1Output1
End If
It compares sensor 8 with the value in counter 1
If <128 (equivalent to > 0) then it does something
Note that counter values 0 to 255. If a comparison result is negative the value in the counter is > 128
eg
Counter 1 =100
Counter 2 = 200
Counter 1 - Counter 2 gives a value in the counter of 100-200+256 = 156
This is because counters have positive values and dont directly support signed arithmetic
You can add the Else condition if the sensor is less than the counter value
Last edited on Friday Sep 16th, 2011 08:46 am by
|