Hardware Reference
In-Depth Information
data = [ # "Lat REAL, Long REAL, AltG REAL, TimeG TEXT, "
35.68981, -78.405353333, 84.8,
'2013-05-02T01:53:41.001Z',
# XA REAL, YA REAL, ZA REAL, ROLL REAL, PITCH REAL, "
0.0, 0.0, 1.0, -1.0, 0.0,
# XM REAL, YM REAL, ZM REAL, XMH REAL, YMH REAL, ZMH
REAL, "
-28.0, -96.0, -216.0, -156.037511025422,
-172.613956848733, -163.739795291688,
# XR REAL, YR REAL, ZR REAL, TempG REAL, "
0.0, -1.0, -1.0, -7.0,
# Pressure REAL, AltP REAL, TempP REAL)")
101426.0, -7.49042223835529, 16.5]
cur.execute("INSERT INTO Sensors VALUES(?" + (",?"*21) + ")", data)
#
# Write out the current sensor data to the dbase
#
def updateDB():
with con:
cur = con.cursor()
data = [lat,lon,altG,timeG,
XYZa[0],XYZa[1],XYZa[2],roll,pitch,
XYZm[0],XYZm[1],XYZm[2],XYZmh[0],XYZmh[1],XYZmh[2],
XYZr[0],XYZr[1],XYZr[2],tempG,
press,altP,tempP]
cur.execute("INSERT INTO Sensors VALUES(?" + (",?"*21) + ")", data)
#
# Roll the dbase so we have the current and a series of older/backup dbases
# This allows each session to be distinct, yet protects against acciden
tal
# erasure of all data if the payload is turned off and then back on
#
def rollDB():
Search WWH ::




Custom Search