diff options
author | Raspberry Pi <raspberrypi@umn.edu> | 2019-11-20 01:22:22 -0600 |
---|---|---|
committer | Raspberry Pi <raspberrypi@umn.edu> | 2019-11-20 01:22:22 -0600 |
commit | caa2d9c446f5901671d30e52b1aaa4c56ef2f25c (patch) | |
tree | e541778f97d291c6bc4f160b4ec8cd9d24d538fb /System_Python/system.py | |
parent | Fixed encoder zeroing. Other minor changes, still trying to get the swingup c... (diff) | |
download | ee4511w-caa2d9c446f5901671d30e52b1aaa4c56ef2f25c.tar ee4511w-caa2d9c446f5901671d30e52b1aaa4c56ef2f25c.tar.gz ee4511w-caa2d9c446f5901671d30e52b1aaa4c56ef2f25c.tar.bz2 ee4511w-caa2d9c446f5901671d30e52b1aaa4c56ef2f25c.tar.lz ee4511w-caa2d9c446f5901671d30e52b1aaa4c56ef2f25c.tar.xz ee4511w-caa2d9c446f5901671d30e52b1aaa4c56ef2f25c.tar.zst ee4511w-caa2d9c446f5901671d30e52b1aaa4c56ef2f25c.zip |
Rework directory structure. Modify result file printing to match requirements of web server.
Diffstat (limited to '')
-rw-r--r-- | System/system.py (renamed from System_Python/system.py) | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/System_Python/system.py b/System/system.py index c6145ce..58ba541 100644 --- a/System_Python/system.py +++ b/System/system.py @@ -6,6 +6,7 @@ from datetime import datetime from time import sleep
import RPi.GPIO as GPIO
import sys
+import os
# IO pin definitions
### Motor pins
@@ -67,7 +68,7 @@ class System: # Create and setup results file (to be sent back to the server and displayed/downloaded to the user)
# Results file is a CSV with the following entries: angle, position, speed
- self.result_filename = "/home/pi/test_results/" + datetime.now().strftime("%d-%m-%Y_%H:%M:%S") + ".csv"
+ self.result_filename = "Results/" + os.path.basename(sys.argv[0]).split('.')[0] + "_results.csv"
result_file = open(self.result_filename, "w+")
result_file.write("angle(" + angular_units + "),position(inches),speed(percentage)\n")
|