Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
You would check your Rcv buffer for '?', then 'f' and call your routine to clear the lcd.
call check_clear
check_clear
movf SER_IN,w
andlw '?'
btfsc STATUS,Z
goto NONE
call Rcv_RS232
movf SER_IN,w
andlw 'f'
btfsc STATUS,Z
goto NONE
movlw 1
call LCD_Cmd
NONE retlw 0
You would duplicate the code posted, edit in the 'g' and have it call BEEP_Cmd , build BEEP_Cmd to make the beep.Hey Ian, thank you so much! Also, how would you do this for '?g' if I want it to make a beep sound? My speaker is assigned to pin 6.
check_clear movf Rcv_Byte,w
sublw '?'
btfss STATUS,Z
goto no_buz
call Rcv_RS232
movf Rcv_Byte,w
sublw 'f'
btfss STATUS,Z
goto no_clear
movlw 1
call LCD_Cmd
retlw 0
no_clear movf Rcv_Byte,w
sublw 'g'
btfss STATUS,Z
goto no_buz
call buzzer
call buzzer
retlw 0
no_buz movf Rcv_Byte,w
call LCD_Char
return