-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a script to test the rocket signals
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Jetson.GPIO as GPIO | ||
import time | ||
|
||
LO_pin = 11 | ||
SOE_pin = 13 | ||
SODS_pin = 15 | ||
|
||
GPIO.setmode(GPIO.BOARD) | ||
|
||
GPIO.setup(LO_pin, GPIO.IN) | ||
GPIO.setup(SOE_pin, GPIO.IN) | ||
GPIO.setup(SODS_pin, GPIO.IN) | ||
|
||
|
||
def get_status_of_signal(signal): | ||
"""Gets the status of the given signal. | ||
Args: | ||
signal (PinsEnum): The signal to get the status of. | ||
Returns: | ||
bool: The status of the given signal. | ||
""" | ||
return GPIO.input(signal) == GPIO.HIGH | ||
|
||
|
||
while True: | ||
print(get_status_of_signal(11)) | ||
print(get_status_of_signal(13)) | ||
print(get_status_of_signal(15)) | ||
print() | ||
time.sleep(1) |