Subversion Repositories yaws

Rev

Rev 6 | Rev 14 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6 Rev 13
Line 19... Line 19...
19
#  along with this program; if not, write to the Free Software
19
#  along with this program; if not, write to the Free Software
20
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21
#  MA 02110-1301, USA.
21
#  MA 02110-1301, USA.
22
#  
22
#  
23
#  
23
#  
-
 
24
cfgPath = './yaws.cfg'
-
 
25
 
24
import database as db
26
import database as db
25
from gpiozero import CPUTemperature
27
from gpiozero import CPUTemperature
26
import time
28
import time
27
import sensors
29
import sensors
Line 36... Line 38...
36
Rainfall = None
38
Rainfall = None
37
Sunlight = None
39
Sunlight = None
38
CPUTemp = None
40
CPUTemp = None
Line 39... Line 41...
39
 
41
 
40
def main(args):
42
def main(args):
41
    conn = create_connection(dbPath)
43
    conn = db.samples.create_connection(dbPath)
42
    while True:
44
    while True:
43
        # get Air tph
45
        # get Air tph
44
        data = sensors.tph.read_tph()
46
        data = sensors.tph.read_tph()
45
        AirTemp = data[0]
47
        AirTemp = data[0]