Skip to content

Commit

Permalink
zero degree fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pilotak committed Dec 9, 2018
1 parent 1f4379e commit db9ff0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion WeatherMeters.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const static uint16_t _windvane_table[16][2] = {
{2475, 599},
{2250, 630},
{3375, 703},
{0, 786},
{0, 730},
{2925, 828},
{3150, 887},
{2700, 945}
Expand Down Expand Up @@ -174,6 +174,8 @@ float WeatherMeters<N>::adcToDir(uint16_t value) {
if (_serial) {
_serial->print(F("[WEATHER] Wind vane ADC:"));
_serial->print(value);
_serial->print(F(", raw dir: "));
_serial->print(dir);
_serial->print(F(", "));
}

Expand All @@ -182,6 +184,8 @@ float WeatherMeters<N>::adcToDir(uint16_t value) {

filtered_dir = round(filtered_dir / 22.5) * 22.5; // get 22.5° resolution

if (filtered_dir >= 360.0) filtered_dir = 0;

if (_serial) {
_serial->print(F("filtered dir: "));
}
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dependencies":
{
"name": "MovingAverageAngle",
"version": "^1.0.2"
"version": "^1.0.3"
},
"version": "2.0.0",
"frameworks": "arduino",
Expand Down

0 comments on commit db9ff0b

Please sign in to comment.