Hardware Reference
In-Depth Information
# Interfaces to the GY-80 10DOF board, and an external GPS to log
# the sensors into a sqllite data base
#
===========================================================================
#
# Standard system libraries needed
#
import os, subprocess, sys, sh, shutil, time
import RPi.GPIO as GPIO
import sqlite3 as db
#
# Custom sensor libraries created for this project
#
from GPS import GPS # GPS lat/long/altitude/time
from ADXL345 import ADXL345 # accelerometer
from BMP085 import BMP085 # pressure + temp
from HMC5883 import HMC5883 # magnetometer (compass) + temp
from L3G4200D import L3G4200D # gyroscope
#
# Camera constants
#
CAMERA_PERIOD = 15 # Number of seconds between each photo
#
# Constants that define the GPIO pins for the LEDs and the enable switch
#
SW_enable = 11 # if ON, take a photo and update dbase (else skip)
LED_status = 23 # RED (False/on, blinks at 0.5hz rate)
LED_gpsok = 24 # GREEN (False/on if GPS lock valid)
LED_camera = 25 # YELLOW (False if dbase write and camera capture enabled)
#
# Simple printable timestamp of the current time
#
def timestamp():
return time.strftime('%x %X %z')
#
# Poll each of the sensor libraries for data
#
def getSensorData():
Search WWH ::




Custom Search