Skip to content
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

Closed

Conversation

sighmon
Copy link
Contributor

@sighmon sighmon commented Jun 20, 2021

Resolves #14

  • Handle SerialError when trying to post to Notecard

@sighmon sighmon closed this Jun 20, 2021
Comment on lines -90 to -102
# 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

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?

Copy link
Contributor Author

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.

@tijmenvandenbrink
Copy link
Owner

@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!

@sighmon
Copy link
Contributor Author

sighmon commented Jul 1, 2021

@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.

@sighmon sighmon closed this Jul 1, 2021
@sighmon sighmon deleted the fix/14-notecard-serial-error branch July 1, 2021 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sleep at end of main thread (or option to)
2 participants