-
Notifications
You must be signed in to change notification settings - Fork 88
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
Update weather.py to show 16 wind directions #221
base: main
Are you sure you want to change the base?
Conversation
This also resolves the issue with having to tare readings more than once.
This seems to crash my enviro-weather when the wind parts are plugged in. I am trying to work out what the issue is, but the board seems to need to be reflashed, so I can't get to the log file sadly. |
Taken the earlier code from @Gadgetoid and cleaned it up a little, as it's better than mine was. I'm also going to update the config.py file to add in the required config.wind_direction_offset which is a nice touch
I think that I have updated this correctly so that the wind direction offset will be set to 0 if not defined
updated to add in weather specific area for the wind_direction_offset
I've updated the code to try and improve pull #163 slightly. I'm not certain why there is the addition of an extra 360 at line 157, and suspect that this could be removed. I've not yet tested this again with the board connected to the the anemometer. |
I've now been running this code for ~1 hour, and it's returning good wind directions. WIll update again in the morning, but it looks good to include. |
I now understand why the extra 360 degrees is added
My board crashed when the wind sensors were added last night, I'm not sure which part of the code causes this issue, or if it's a physical hardware issue. When there are no sensors connected, it's fine, but when they are it regularly crashes. |
@MrDrem As #163 was working ok when I last tested it I wanted to see what improvements you were making and see if I could help get one of these PRs in. I note you caught my copy paste error on the default wind direction config, which I have fixed in my branch and I have also rebased my PR branch against main to make comparisons easier. Comparing yours and my branch I can only see some comments removed which I failed to remove with the associated code (will adjust in my branch as well), am I messing up the compare and there's other changes made I should take a look at? I can then test both branches with mine and see if it's code or board specific. |
@sjefferson99 I'd done it slightly differently initially, but looking at your method yours seemed better so I changed it to match that and bring it up to the new codebase. The changes in the end were just the tidying. I'm fairly sure that my issues are board specific, but as my board was gifted by in-laws, and it works intermittently (no issues for the last ~5 hours, but it will stop soon I suspect), getting hold of Pimorini to try and exchange it is a bit of a hassle that I've not had time to do, and I've had it for so long now that it's going to be out of warranty. |
@MrDrem OK, as I've rebased mine on updated main and committed the bits I missed first time (Thanks for catching), my original PR should be the same. I'll copy the code from it to my board and test when I get a minute and see if it still runs... |
This also resolves the issue with having to tare readings more than once.