Added led_test.py and copyright notices

This commit is contained in:
BlueFox 2024-03-16 14:47:33 +01:00
parent 57a0714738
commit 52834f0562
4 changed files with 79 additions and 2 deletions

41
led_test.py Normal file
View File

@ -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 <https://www.gnu.org/licenses/>.
"""
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)

View File

@ -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 <https://www.gnu.org/licenses/>.
"""
from SX127x import SX127x
from machine import Pin, SPI
from time import sleep, time_ns

View File

@ -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 <https://www.gnu.org/licenses/>.
"""
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()
run()

View File

@ -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 <https://www.gnu.org/licenses/>.
"""
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()
run()