I would like to read out the compass module CMPS11 via RS232, I send the command 0x13 then the module sends back 2 bytes. How can I read these 2 bytes?
Code: Select all
UART1_Write(0x13)
Delay_ms(100)
if (UART1_Data_Ready() = 1) then
re_high = UART1_Read()
end if
if (UART1_Data_Ready() = 1) then
re_low = UART1_Read()
end if
angle=re_high*256
angle= angle+re_low
thank you for your help