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

WinDir SW/W seems to be incorrect #11

Open
Pakl8 opened this issue Sep 16, 2020 · 3 comments
Open

WinDir SW/W seems to be incorrect #11

Pakl8 opened this issue Sep 16, 2020 · 3 comments

Comments

@Pakl8
Copy link

Pakl8 commented Sep 16, 2020

The wind direction SW gives U8:8 and Enum:8, but shows direction North
The wind direction W gives U8:14 and Enum:8 but shows direction North
All other directions mappings looks to be correct.

@Pakl8
Copy link
Author

Pakl8 commented Sep 27, 2020

The resistance of the direction west is 120K (see elektor weather station mark1, page 30) which gives Dir-ADC3870, u8val 15 and enumval 8, but will not pass if(u8_dir < 15){ WindDir = obj->WindDirLUT[u8_dir]; changed it to if(u8_dir < 16){ WindDir = obj->WindDirLUT[u8_dir]; } and now it gives enum value 6, which is west
}

@lab-mathias-claussen
Copy link
Collaborator

Hello Pakl8,

thanks for looking into this issue. We will incooperate the changes.

Best Regards

Mathias Claußen

@t3hoe
Copy link

t3hoe commented Oct 2, 2020

Hello.
I found some faults in the WindDirSensor.cpp
After the correction the sensor provides plausible values in all 3 channels
From winddir you can get only the 10s average (see line 230 and 237) the switch case instraction is wrong.
The calculation of average_60s is wrong (line 178). When you add 6 values then you must divide by 6 not by 10.
The calculation of average_3600s is also wrong. You have to add all 60 values (line198) and then divide by 60 (line 202).
Regards
Thomas

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

No branches or pull requests

3 participants