Hardware Reference
In-Depth Information
gps = GPS()
acc = ADXL345()
pressure = BMP085()
compass = HMC5883()
gyro = L3G4200D()
# Start up the background GPS thread
gps.start()
# Roll the old dbase values and create a new one for this mission
rollDB()
createDB()
# Flash the LEDs for 2 seconds - this is a good visual indication that
# the program is up and the LEDs all work, as well as it works as a
# time delay to make sure the libraries are stable (background GPS task)
for loop in range(0,4):
blink_on = ((loop & 1) == 1)
GPIO.output(LED_status, blink_on)
GPIO.output(LED_gpsok, blink_on)
GPIO.output(LED_camera, blink_on)
time.sleep (0.5)
# Acivity boolean - toggles on each loop (controls activity LED)
activity = True
# Set up the next camera time so a photo will be taken as soon as the
# enable switch is turned on
next_camera_time = 0
# Run forever
while True:
# Read from each of the sensors
getSensorData()
# Toggle the activity LED
activity = not activity
GPIO.output(LED_status, activity)
# Indicate GPS status on the green LED
GPIO.output(LED_gpsok, (GPSdata == None))
# If the enable switch is on, then update the dbase and take a picture
Search WWH ::




Custom Search