diff --git a/led_test.py b/led_test.py new file mode 100644 index 0000000..cd1de81 --- /dev/null +++ b/led_test.py @@ -0,0 +1,41 @@ +""" +LoRa-Training / led_tester - Test the leds connected to the board (called green and red) +Copyright (C) 2024 Benjamin Burkhardt + +This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with this program. If not, see . +""" + +from machine import Pin +from time import sleep +import gc + +def run(run_forever=False): + green = Pin(26, Pin.OUT) + red = Pin(27, Pin.OUT) + + g = True + r = None + counter = 0 + + while counter < 4 or run_forever: + r = g + g = not g + + red.value(r) + green.value(g) + + counter += 1 + sleep(0.5) + + if not run_forever: # do cleanup + red.value(0) + green.value(0) + gc.collect() + + +if __name__ == "__main__": + run(True) diff --git a/lora_pingpong.py b/lora_pingpong.py index d080936..b302d01 100644 --- a/lora_pingpong.py +++ b/lora_pingpong.py @@ -1,3 +1,15 @@ +""" +LoRa-Training / lora_pingpong - A simple lora pingpong program for testing reasons +Copyright (C) 2024 Benjamin Burkhardt + +This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with this program. If not, see . +""" + + from SX127x import SX127x from machine import Pin, SPI from time import sleep, time_ns diff --git a/lora_receiver.py b/lora_receiver.py index 4da88bc..66735ee 100644 --- a/lora_receiver.py +++ b/lora_receiver.py @@ -1,3 +1,15 @@ +""" +LoRa-Training / led_receiver - listen to all messages sent over LoRa and print them on serial (and LCD) +Copyright (C) 2024 Benjamin Burkhardt + +This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with this program. If not, see . +""" + + from SX127x import SX127x from machine import Pin, SPI from time import sleep @@ -63,4 +75,4 @@ def run(): receive(lora, 7, lcd_connected=True) if __name__ == '__main__': - run() \ No newline at end of file + run() diff --git a/lora_sender.py b/lora_sender.py index a370fae..5b778bc 100644 --- a/lora_sender.py +++ b/lora_sender.py @@ -1,3 +1,15 @@ +""" +LoRa-Training / led_sender - Send a simple lora message frequently +Copyright (C) 2024 Benjamin Burkhardt + +This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with this program. If not, see . +""" + + from SX127x import SX127x from machine import Pin, SPI from time import sleep @@ -67,4 +79,4 @@ def run(): send(lora, 7, lcd_connected=True) if __name__ == '__main__': - run() \ No newline at end of file + run()