Code: Select all
Dim c as Word
{
...skipping part of the code...
}
Initialize
While 1=1
While DataAvailableTimeout(10)
c = USART.ReadWord
USART.write("Received: ")
USART.Write(c)
USART.write(". ", 13,10)
{ ...commented this out for now
If c = "Off" Then
mStatusLED_Off()
USART.Write("LED turned off")
ElseIf c = "On" Then
mStatusLED_On()
USART.Write("LED turned on")
EndIf
}
Wend
Wend
Im a bit confused about certain things:
1) why does my message through simulator has to be in hex?
2) given above, why can the message sent through USART.write be a string?
2) is there anyway to get all bytes that come through? (would really appreciate link to a sample code/tutorial)
As you can see from code above, I wanted to test if I can use USART to turn on/off LED, but I'm stuck D:
cheers