Code: Select all
import time
import colorama
from colorama import *
import Adafruit_BMP.BMP085 as BMP085
sensor = BMP085.BMP085()
colorama.init()
starttemp= MAKE THIS A CONSTANT WITH THE STARING TEMP
startpress = MAKE THIS A CONSTANT WITH STARTING PRESSURE
for i in range(0,6):
print('\n')
try:
while True:
temp = sensor.read_temperature()
pressure = sensor.read_pressure()
tp = "Temp: %.2f *F" % ((temp * 1.8) + 32)
pp = "Pressure: %.2f millibars" % (pressure / 100.0)
p1 = str(pp)
t1 = str(tp)
print(Fore.MAGENTA + p1)
print(Fore.BLUE + t1 + '\n\n\n\n\n\n\n\n\n\n' + Style.RESET_ALL)
time.sleep(3)
except KeyboardInterrupt:
ENDTEMP = The ending temp which I need made
ENDPRESS = the ending pressure which I need made
print starttemp
print startpress
print endtemp
print endpress