From 1a6c45164d4e1579af81971e5c573c1c34dd4ccd Mon Sep 17 00:00:00 2001 From: st33v Date: Thu, 15 Jun 2017 18:03:23 +1000 Subject: overdue cleanup --- .gitignore | 1 + ldr-counter.py | 8 ++++---- ldr-counter.service | 5 ++++- x | 0 4 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 .gitignore delete mode 100644 x 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 -- cgit v1.3