Code: Select all
sub procedure Usart1_Interrupt org URXCaddr
CLI
ptr^= UDR ' reading received data
ptr = ptr + 1 ' increment address of pointer
inc(index)
if index = END_INDEX then ' if is it get the end of array
ptr = @receive_array ' start from begin
index = 0
usart1_write_char(receive_array[0])
usart1_write_char(receive_array[1])
usart1_write_char(receive_array[2])
if (receive_array[0] = "R") then
if (receive_array[1] = "T") then
printtemp(receive_array[2]
end if
end if
end if
SEI
end sub
Code: Select all
sub procedure printtemp(dim tempt as integer)
IntToStr(t[tempt],text)
Usart1_Write_char(text[0])
Usart1_Write_char(text[1])
Usart1_Write_text(".")
IntToStr(t1[tempt],text)
Usart1_Write_char(text[0])
Usart1_Write_char(176) ' "degree" character
usart1_write_char("C")
end sub