Uart bit stream example: suppose there are 3 buttons, Amulet:UART.byte(0).setValue(0xXX), where XX is hex number associated with each button, for example, button #1 has a value 0x01 and button #2 has 0x02. What is the UART bit stream?
The command to set a UART byte from the amulet is the exact same as setting an InternalRAM byte from your processor, other than the data "0xXX", you see the opcode 0xD5 followed by the address in ASCII, in this case 0x30 0x30, and then the byte value in ASCII. If your XX was equal to FF, the whole message would be 0xD5 0x30 0x30 0x46 0x46 there are a couple of choices on how you reply, but the default is to echo the data with an opcode of 0xE5, so you would send 0xE5 0x30 0x30 0x46 0x46.
In general, most messages that start with 0xD0 through 0xDF are master messages and ones that start with 0xE0 through 0xEF are their slave responses
Please login or Register to submit your answer