Removed old programs for uniformity in this repo

This commit is contained in:
BlueFox 2024-03-16 14:37:21 +01:00
parent 9112d8980b
commit 57a0714738
3 changed files with 34 additions and 32 deletions

View File

@ -148,6 +148,8 @@ def pingpong(lora, initializer: bool, lcd_connected=True, interrupt_pin=None):
as_responder(lora, lcd, lcd_connected, interrupt_pin)
# initialize LoRa
device_spi = SPI(baudrate = 10000000,
polarity = 0, phase = 0, bits = 8, firstbit = SPI.MSB, id=0,
sck = Pin(2, Pin.OUT, Pin.PULL_DOWN),
@ -168,9 +170,22 @@ parameters = {
'invert_IQ': False,
}
def run():
lora = SX127x(device_spi, pins={"dio_0": 6, "ss": 5, "led": 27}, parameters=parameters)
lora = SX127x(device_spi, pins={"dio_0": 6, "ss": 5, "led": 27}, parameters=parameters)"
# The run function (for different options; see below the "if __name__ == ..." section)
def run_lcd_init():
pingpong(lora, initializer=True, lcd_connected=True)
def run_wo_lcd_init():
pingpong(lora, initializer=True, lcd_connected=False)
def run_lcd_resp():
pingpong(lora, initializer=False, lcd_connected=True)
def run_wo_lcd_resp():
pingpong(lora, initializer=False, lcd_connected=False)"
if __name__ == "__main__":
run()
#run_lcd_resp() # run as responder (with lcd)
#run_wo_lcd_resp() # run as responder (without lcd)
#run_lcd_init() # run as initializer (with lcd)
run_wo_lcd_init() # run as initializer (without lcd)

View File

@ -2,10 +2,6 @@ from ProgramChooser import ProgramChooser
import sys
import gc
def micronec_run():
from micronEC import micronec
micronec.run()
gc.collect()
def lora_receiver_run():
from lora_simple import lora_receiver
lora_receiver.run()
@ -14,32 +10,21 @@ def lora_sender_run():
from lora_simple import lora_sender
lora_sender.run()
gc.collect()
def lora_pingpong_run():
def lora_pingpong_init():
import lora_pingpong
lora_pingpong.run()
lora_pingpong.run_lcd_init()
gc.collect()
def lcd_big_hello_run():
from lcd_examples import lcd_big_hello
lcd_big_hello.run()
gc.collect()
def lcd_libtest_run():
from lcd_examples import lcd_libtest
lcd_libtest.run()
gc.collect()
def led_test_run():
from excercise import led_test
led_test.run()
def lora_pingpong_resp():
import lora_pingpong
lora_pingpong.run_lcd_resp()
gc.collect()
programs = {
"micronEC": micronec_run,
"lorareceiver": lora_receiver_run,
"lorasender": lora_sender_run,
"lora_pingpong": lora_pingpong_run,
"lcd_big_hello": lcd_big_hello_run,
"lcd_libtest": lcd_libtest_run,
"led_blink": led_test_run,
"simplereceiver": lora_receiver_run,
"simplesender": lora_sender_run,
"pingpong_init": lora_pingpong_init,
"pingpong_resp": lora_pingpong_resp,
}
pc = ProgramChooser(programs, 7, 8, debug=True)
pc.run()
pc.run()

View File

@ -1,11 +1,13 @@
from simplelora import sender, receiver
import lora_pingpong
to_run = 0 # 0: ping-pong | 1: sender | 2: receiver
to_run = 0 # 0: ping-pong as responder | 1: ping-pong as initializer | 2: sender | 3: receiver
if to_run == 0:
lora_pingpong.run()
elif to_run == 1:
sender.run()
lora_pingpong.run_wo_lcd_resp()
if to_run == 1:
lora_pingpong.run_wo_lcd_init()
elif to_run == 2:
sender.run()
elif to_run == 3:
receiver.run()