summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorst33v <github@f3rr3t.com>2017-06-15 18:03:23 +1000
committerst33v <github@f3rr3t.com>2017-06-15 18:03:23 +1000
commit1a6c45164d4e1579af81971e5c573c1c34dd4ccd (patch)
treebb6f320df0923fd188592d4b0dea1cdbc403963d
parent7539c612381ee6f674ae4649aa32df237607c65e (diff)
overdue cleanupHEADmaster
-rw-r--r--.gitignore1
-rwxr-xr-xldr-counter.py8
-rw-r--r--ldr-counter.service5
-rw-r--r--x0
4 files changed, 9 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..aad3d38
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+ldr-readings.txt
diff --git a/ldr-counter.py b/ldr-counter.py
index 362ab55..a399457 100755
--- a/ldr-counter.py
+++ b/ldr-counter.py
@@ -61,7 +61,7 @@ def appendReading (ldrCount):
timestamp = datetime.now(timezone.utc).astimezone().isoformat()
# write the data
- f = open("ldr-readings.txt", "a")
+ f = open("/home/st33v/sense/light/ldr-readings.txt", "a")
f.write(timestamp + ' ' + " ".join(map(str, ldrCount)) + '\n')
f.close()
@@ -70,10 +70,10 @@ def appendReading (ldrCount):
obs=list() # an empty list
for num in range(0, obsCount):
obs.append(RCtime())
- print(obs)
+# print(obs)
-print("sum=", sum(obs))
-print("Ave time: ", sum(obs)/obsCount) # Measure timing using GPIO4
+#print("sum =", sum(obs))
+#print("Ave time: ", sum(obs)/obsCount) # Measure timing using GPIO4
appendReading(obs)
diff --git a/ldr-counter.service b/ldr-counter.service
index 64c113c..495835d 100644
--- a/ldr-counter.service
+++ b/ldr-counter.service
@@ -3,6 +3,9 @@ Description=Read light level from LDR and store result in file
[Service]
Type=oneshot
-User=st33v
+User=root
# WorkingDirectory=/home/st33v/light/
ExecStart=/usr/local/bin/ldr-counter.py
+
+[Install]
+WantedBy=ldr-counter.timer
diff --git a/x b/x
deleted file mode 100644
index e69de29..0000000
--- a/x
+++ /dev/null