Quote Originally Posted by mat janssen
Test if the first number is greater then the second number and then do the subtraction. If otherwise then do nothing.
Thank you.
I use this code:

Code:
    If value >= P2 then
        If (value - P2) >= 1 then
            PORTB.1=1
            else
            PORTB.1=0
            endif
        endif