From 9112d8980b95cba6cd018d4f5d3cda668806d026 Mon Sep 17 00:00:00 2001 From: BlueFox Date: Sat, 16 Mar 2024 14:26:33 +0100 Subject: [PATCH] Added two main.py files, either for setups with, or without LCD screen added! --- main_+lcd.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ main_-lcd.py | 11 +++++++++++ 2 files changed, 56 insertions(+) create mode 100644 main_+lcd.py create mode 100644 main_-lcd.py diff --git a/main_+lcd.py b/main_+lcd.py new file mode 100644 index 0000000..63d3267 --- /dev/null +++ b/main_+lcd.py @@ -0,0 +1,45 @@ +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() + gc.collect() +def lora_sender_run(): + from lora_simple import lora_sender + lora_sender.run() + gc.collect() +def lora_pingpong_run(): + import lora_pingpong + lora_pingpong.run() + 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() + 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, + } + +pc = ProgramChooser(programs, 7, 8, debug=True) +pc.run() \ No newline at end of file diff --git a/main_-lcd.py b/main_-lcd.py new file mode 100644 index 0000000..0c6d3ac --- /dev/null +++ b/main_-lcd.py @@ -0,0 +1,11 @@ +from simplelora import sender, receiver +import lora_pingpong + +to_run = 0 # 0: ping-pong | 1: sender | 2: receiver + +if to_run == 0: + lora_pingpong.run() +elif to_run == 1: + sender.run() +elif to_run == 2: + receiver.run()