Migrated to arduino
This commit is contained in:
13
esp32-lora/light-sensor-python/lora.py
Normal file
13
esp32-lora/light-sensor-python/lora.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from machine import Pin, SPI
|
||||
from sx127x import SX127x
|
||||
|
||||
# SPI bus
|
||||
spi = SPI(1, baudrate=1000000, polarity=0, phase=0,
|
||||
sck=Pin(18), mosi=Pin(23), miso=Pin(19))
|
||||
|
||||
# LoRa module
|
||||
lora = SX127x(spi, cs=Pin(14), reset=Pin(26), irq=Pin(33),
|
||||
freq=868E6, # or 915E6 depending on region
|
||||
sf=7, # spreading factor
|
||||
bw=125E3, # bandwidth
|
||||
cr=5) # coding rate
|
||||
Reference in New Issue
Block a user