-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlora_tx.py
More file actions
36 lines (30 loc) · 708 Bytes
/
lora_tx.py
File metadata and controls
36 lines (30 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import time
LORA_CFG = {
"freq_khz": 915000,
"sf": 7,
"bw": 125,
"coding_rate": 5,
"preamble_len": 8,
"output_power": 5,
"crc": True,
"invert_iq": False,
}
def update_display(counter):
display.fill(0)
display.text("Sending...", 0, 0, 1)
display.text(str(counter), 0, 12, 1)
display.show()
def main():
print("Initializing...")
modem = get_modem(LORA_CFG)
display.fill(0)
display.text("Sending...", 0, 0, 1)
display.show()
counter = 0
while True:
print("Sending...")
update_display(counter)
modem.send(f"Hello world from MicroPython #{counter}".encode())
time.sleep(2)
counter += 1
main()