forked from cameron-woodard/PiPaw
-
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.
Merge pull request #4 from ubcbraincircuits/dev
Feat: update to version 2.4
- Loading branch information
Showing
18 changed files
with
1,459 additions
and
1,234 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,43 @@ | ||
import os | ||
import sys | ||
import subprocess | ||
|
||
TESTS = { | ||
'solenoid': 'solenoid_test', | ||
'rfid': 'RFID_buffer_testing', | ||
'infrared': 'infrared_test', | ||
'encoder': 'encoder_test', | ||
'camera': 'camera_test', | ||
'motor': 'motor_test' | ||
} | ||
|
||
|
||
def run_test(part): | ||
module = f"src.tests.{TESTS[part]}" | ||
command = ["python3", "-m", module] | ||
try: | ||
subprocess.run(command, check=True) | ||
except subprocess.CalledProcessError as e: | ||
print(f"Error running {module}: {e}") | ||
|
||
|
||
def run(): | ||
module = "src.piPaw_pert" | ||
command = ["python3", "-m", module] | ||
try: | ||
subprocess.run(command, check=True) | ||
except subprocess.CalledProcessError as e: | ||
print(f"Error running {module}: {e}") | ||
|
||
|
||
def main(): | ||
if sys.argv[1] == "test": | ||
arg = sys.argv[2] | ||
run_test(arg) | ||
|
||
if sys.argv[1] == "run": | ||
run() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
cd /home/pi/piPaw/ | ||
until python3 -u piPaw_amplitude.py &>>log.txt; do | ||
cd /home/pi/PiPaw/ | ||
until python3 -u src/piPaw_amplitude.py &>>log.txt; do | ||
echo "'piPaw program' crashed with exit code $?. Restarting..." >&2 | ||
sleep 1 | ||
done |
Oops, something went wrong.