-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#14 Fix notecard serial error #15
#14 Fix notecard serial error #15
Conversation
… captured_at at post time
# Tuning factor for compensation. Decrease this number to adjust the | ||
# temperature down, and increase to adjust up | ||
raw_temp = bme280.get_temperature() | ||
|
||
if factor: | ||
cpu_temps = [get_cpu_temperature()] * 5 | ||
cpu_temp = get_cpu_temperature() | ||
# Smooth out with some averaging to decrease jitter | ||
cpu_temps = cpu_temps[1:] + [cpu_temp] | ||
avg_cpu_temp = sum(cpu_temps) / float(len(cpu_temps)) | ||
temperature = raw_temp - ((avg_cpu_temp - raw_temp) / factor) | ||
else: | ||
temperature = raw_temp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sighmon what's your idea about changing this to a more basic approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tijmenvandenbrink It wasn't working out linearly across the temperature range for me and also didn't take into account the humidity changes from the extra heat. My simplistic version isn't great either, so I'll keep working on it.
@sighmon seems to have some conflicts before I can merge them. Would you care to fix them and I will merge the changes. Thanks for your contribution! |
@tijmenvandenbrink Sorry, I didn't mean to open this in your repo - I'm still playing around with a few things here, so I'll create a fresh PR when it's ready. |
Resolves #14
SerialError
when trying to post to Notecard