Skip to content

Transmit Operation

Chandra Wijaya Sentosa edited this page Jan 12, 2022 · 2 revisions

Transmit Operation

Transmit operation begin with calling beginPacket() method following by write() method to write package to be tansmitted and ended with calling endPacket() method. For example, to transmit "HeLoRa World!" message and an increment counter you can use following code.

# message and counter to transmit
message = "HeLoRa World!\0"
messageList = list(message)
for i in range(len(messageList)) : messageList[i] = ord(messageList[i])
counter = 0

LoRa.beginPacket()
LoRa.write(message, sizeof(message)) # write multiple bytes
LoRa.write(counter)                  # write single byte
LoRa.endPacket()
LoRa.wait()
counter += 1

Structured Transmit Data

Transmit With Timeout

Using Interrupt

Transmit Callback