ewandingwall
New Member
good day all, I am building a temperature sensor alarm and i am having a look at the code in the manual where it states the code for reading temperature is:
main: readtemp C.1,b1 ; read value into b1
if b1 > 127 then negative ; test for negative
serout B.7,N2400,(#b1,"C") ; transmit value to serial LCD
goto main
negative: let b1 = b1 - 128 ; adjust neg value
serout B.7,N2400,("-") ; transmit negative symbol
serout B.7,N2400,(#b1,"C") ; transmit value to serial LCD
goto main
can anyone help with what if b1 > 127 then negative means? im finding the coding slightly confusing and vague.
many thanks
main: readtemp C.1,b1 ; read value into b1
if b1 > 127 then negative ; test for negative
serout B.7,N2400,(#b1,"C") ; transmit value to serial LCD
goto main
negative: let b1 = b1 - 128 ; adjust neg value
serout B.7,N2400,("-") ; transmit negative symbol
serout B.7,N2400,(#b1,"C") ; transmit value to serial LCD
goto main
can anyone help with what if b1 > 127 then negative means? im finding the coding slightly confusing and vague.
many thanks