<commit_before>#read data from a BME280 Sensor and write it into a LOG<date>.txt file
#
#author <NAME>
#version 1.0 25.03.16

from time import *
import time
from Adafruit_BME280 import *
import os

sensor = BME280(mode=BME280_OSAMPLE_8)

temp = sensor.read_temperature()
pascals = sensor.read_pressure()
press = pascals / 100
hum = sensor.read_humidity()

def writeDATA():
        #write year, month and day in the title
	f = open('LOG' + strftime("%Y%m%d", time.localtime()) + '.txt', 'a')
	if os.stat('LOG' + strftime("%Y%m%d", time.localtime()) + '.txt').st_size == 0:
		f.write("TEMP|PRESS|HUM\n")
	f.write(time.strftime("%Y%m%d%H%M%S", time.localtime()) + '\n' + 
                '{}|{}|{}\n'.format(temp, press, hum))
	f.close()

	
while True:
	writeDATA()
	#900 = 15 min
	time.sleep(2)<commit_msg>Fixing Sensor Reading Bug<commit_after>#read data from a BME280 Sensor and write it into a LOG<date>.txt file
#
#author <NAME>
#version 1.1 25.03.16

from time import *
import time
from Adafruit_BME280 import *
import os

sensor = BME280(mode=BME280_OSAMPLE_8)

def writeDATA():

        temp = sensor.read_temperature()
        pascals = sensor.read_pressure()
        press = pascals / 100
        hum = sensor.read_humidity()

        #write year, month and day in the title
	f = open('LOG' + strftime("%Y%m%d", time.localtime()) + '.txt', 'a')
	if os.stat('LOG' + strftime("%Y%m%d", time.localtime()) + '.txt').st_size == 0:
		f.write("TEMP|PRESS|HUM\n")
	f.write(time.strftime("%Y%m%d%H%M%S", time.localtime()) + '\n' + 
                '{}|{}|{}\n'.format(temp, press, hum))
	f.close()

	
while True:
	writeDATA()
	#900 = 15 min
	time.sleep(2)
{'fraction_non_alphanumeric': 0.17785843920145192, 'fraction_numerical': 0.03750756200846945, 'mean_word_length': 3.685552407932011, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4955040', 'n_tokens_mistral': 695, 'n_tokens_neox': 623, 'n_words': 154}