forked from Telos4/LoRa-Workshop
added receive example
This commit is contained in:
parent
3861ebe2b3
commit
f769ccdfdc
20
micropython/examples/lora_recv.py
Normal file
20
micropython/examples/lora_recv.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
from lora_transceiver import LoRaTransceiver
|
||||||
|
|
||||||
|
from uPySensors.ssd1306_i2c import Display
|
||||||
|
|
||||||
|
d = Display()
|
||||||
|
|
||||||
|
# create transceiver for LoRaWAN frequency (channel 0 = 868.1 Mhz)
|
||||||
|
lora = LoRaTransceiver(frequency=868.1E6, syncword=0x34, display=d)
|
||||||
|
|
||||||
|
# change the spreading factor
|
||||||
|
lora.setSpreadingFactor(7)
|
||||||
|
|
||||||
|
# sending string data
|
||||||
|
#lora.send_string('imaginaerraum')
|
||||||
|
|
||||||
|
# sending raw data
|
||||||
|
#lora.send([0x61, 0x62, 0x63])
|
||||||
|
|
||||||
|
# start receiving data
|
||||||
|
lora.recv()
|
Loading…
Reference in New Issue
Block a user