Skip to content
Snippets Groups Projects
Commit 3b2d1679 authored by CARNEIRO--GILLET Alexandre's avatar CARNEIRO--GILLET Alexandre
Browse files

tests pylora, ça a l'air de marcher

parent b7d493ee
Branches
No related tags found
No related merge requests found
File added
{
"address": "COM6",
"username": "micro",
"password": "python",
"open_on_start": true,
"safe_boot_on_upload": true,
"sync_file_types": "py",
"py_ignore": [
"pymakr.conf",
"dev-requirements.txt",
".vscode",
"LICENSE",
".gitignore",
".git",
"project.pymakr",
"env",
"venv",
".python-version",
".micropy/",
"micropy.json"
],
"fast_upload": false
}
\ No newline at end of file
#import LoRaDuplexCallback
#import LoRaPingPong
#import LoRaSender
from examples import LoRaSender
from examples import LoRaReceiver
import _thread
import time
from config import *
from machine import Pin, SPI
from examples import LoRaReceiver, LoRaSender
from machine import SPI, Pin
from sx127x import SX127x
device_spi = SPI(baudrate = 10000000,
......@@ -19,6 +20,17 @@ lora = SX127x(device_spi, pins=device_config, parameters=lora_parameters)
#example = 'sender'
example = 'receiver'
led = Pin(2, Pin.OUT) # Assuming GPIO2 is used for the LED
def blink_led():
led.on()
time.sleep(0.5)
led.off()
time.sleep(0.5)
# Start a thread to blink the LED
_thread.start_new_thread(lambda: [blink_led() for _ in iter(int, 1)], ())
if __name__ == '__main__':
if example == 'sender':
LoRaSender.send(lora)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment