be80be
Well-Known Member
I'm trying to subtract revived 0x31 that's saved in datarecved var.
But when I send 0x30 the test should be false and skip to turn led off it doesn't happen
here the code
But when I send 0x30 the test should be false and skip to turn led off it doesn't happen
here the code
Code:
Start call Rcv_RS232 ; gets the data from the rx pin
call LED ; If we get data then lets turn on a led
goto Start ;No data come back and keep looking
LED
movlw 0x31 ; loads test_byte wit hex 31
movwf test_byte
movf test_byte,W ; moves to W
subwf datarecved,W ; this should have 0x31
btfss STATUS,Z ; if this is 0
goto Led_on ; led is on if 0
goto Led_off ; led is off if 1
Led_on
bsf GPIO,5
goto Start ; returns to start to loop for new data
Led_off
bcf GPIO,5
goto Start