Started work on a raspi
This commit is contained in:
parent
05562e425b
commit
66bc040ba8
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,7 @@
|
|||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
*$py.class
|
*$py.class
|
||||||
|
checklist.json
|
||||||
|
|
||||||
# C extensions
|
# C extensions
|
||||||
*.so
|
*.so
|
||||||
|
2
TODO.md
2
TODO.md
@ -1,7 +1,7 @@
|
|||||||
* [x] implement ssb
|
* [x] implement ssb
|
||||||
* [x] create main.py
|
* [x] create main.py
|
||||||
* [x] eat dinner
|
* [x] eat dinner
|
||||||
* [ ] start working on an actual raspberry pi
|
* [x] start working on an actual raspberry pi
|
||||||
* [ ] get all parts needed
|
* [ ] get all parts needed
|
||||||
* [x] calculate the entire cost, so you can boast that it's probably two-three times cheaper than the cheapest QRP out there
|
* [x] calculate the entire cost, so you can boast that it's probably two-three times cheaper than the cheapest QRP out there
|
||||||
* [ ] write the code for the screen/leds/buttons
|
* [ ] write the code for the screen/leds/buttons
|
||||||
|
17
main.py
17
main.py
@ -0,0 +1,17 @@
|
|||||||
|
import RPi.GPIO as GPIO
|
||||||
|
|
||||||
|
def button_press(pin:int):
|
||||||
|
def button_callback(channel):
|
||||||
|
GPIO.cleanup()
|
||||||
|
return True
|
||||||
|
|
||||||
|
GPIO.setwarnings(False)
|
||||||
|
GPIO.setmode(GPIO.BOARD) # physical numbers
|
||||||
|
|
||||||
|
GPIO.setup(pin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
|
||||||
|
GPIO.add_event_detect(pin,GPIO.RISING,callback=button_callback)
|
||||||
|
GPIO.cleanup()
|
||||||
|
return False
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print(button_press(19))
|
Loading…
x
Reference in New Issue
Block a user