projects
/
svn42.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c28acc8
)
works. todo: separate script that adds up movements
author
Bernhard Tittelbach
<xro@realraum.at>
Thu, 18 Mar 2010 22:16:40 +0000
(22:16 +0000)
committer
Bernhard Tittelbach
<xro@realraum.at>
Thu, 18 Mar 2010 22:16:40 +0000
(22:16 +0000)
sensor_graph/sample_sensor3.lua
patch
|
blob
|
history
diff --git
a/sensor_graph/sample_sensor3.lua
b/sensor_graph/sample_sensor3.lua
index
9d73d57
..
f2e469a
100755
(executable)
--- a/
sensor_graph/sample_sensor3.lua
+++ b/
sensor_graph/sample_sensor3.lua
@@
-7,15
+7,15
@@
require('io')
function parse_value(str)
last_temp = 0.0
last_light = 0
function parse_value(str)
last_temp = 0.0
last_light = 0
- if string.find(str,"Sensor T: Temp C:") then
- last_temp = tonumber(string.sub(str,18))
+ if string.find(str,"temp0: Temp C:") then
+ last_temp = tonumber(string.sub(str,15))
os.execute(string.format("rrdtool update /home/sensortemp.rrd -t temp N:%f", last_temp))
os.execute(string.format("rrdtool update /home/sensortemp.rrd -t temp N:%f", last_temp))
- print(string.format("t: %f Grad Celsius",last_temp))
+ --print(string.format("t: %f Grad Celsius",last_temp))
end
end
- if string.find(str,"Sensor P: Photo:") then
- last_light = tonumber(string.sub(str,17))
+ if string.find(str,"photo0: Photo:") then
+ last_light = tonumber(string.sub(str,15))
os.execute(string.format("rrdtool update /home/sensorlight.rrd -t light N:%d", last_light))
os.execute(string.format("rrdtool update /home/sensorlight.rrd -t light N:%d", last_light))
- print(string.format("p: %d",last_light))
+ --print(string.format("p: %d",last_light))
end
if string.find(str,"movement") then
--last_movement=1
end
if string.find(str,"movement") then
--last_movement=1