Skip to content

Commit

Permalink
Merge pull request #490 from luebbe/main
Browse files Browse the repository at this point in the history
Send LDR and BATT raw values through standard median and mean filters…
  • Loading branch information
Blueforcer authored Mar 8, 2024
2 parents e99c1b5 + 301d694 commit b9d78ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PeripheryManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ void PeripheryManager_::tick()
uint16_t LDRVALUE = analogRead(LDR_PIN);

// Send LDR values through median filter to get rid of the remaining spikes and then calculate the average
LDR_RAW = medianFilterLDR.AddValue(medianFilterLDR.AddValue(LDRVALUE));
LDR_RAW = meanFilterLDR.AddValue(medianFilterLDR.AddValue(LDRVALUE));
CURRENT_LUX = (roundf(photocell.getSmoothedLux() * 1000) / 1000);
if (AUTO_BRIGHTNESS && !MATRIX_OFF)
{
Expand Down

10 comments on commit b9d78ef

@ivankravets
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Blueforcer
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mhh. It compiles fine on my local machine

@ivankravets
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows OS is not case sensitive. The issue was fixed in this commit (later after 1.0.0 was release) luisllamasbinaburo/Arduino-MedianFilter@53e1273

@Blueforcer
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok, i will changed it

@ivankravets
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for not being specific. Your code is good and thanks for using PlatformIO!

I cc-ed in this thread @luisllamasbinaburo , the author of https://registry.platformio.org/libraries/luisllamasbinaburo/MedianFilterLib . It would be great if he published a new version containing the fix to this issue.

Otherwise, you can use https://github.com/luisllamasbinaburo/Arduino-MedianFilter.git directly instead of the registry 1.0.0 version

@Blueforcer
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already done, wcomes with the next commit / release

@luisllamasbinaburo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ivankravets
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luisllamasbinaburo , you need to update the library manifest in the main branch and later create a new release. See https://github.com/luisllamasbinaburo/Arduino-MedianFilter/blob/v1.0.1/library.properties#L2

@luisllamasbinaburo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luisllamasbinaburo , you need to update the library manifest in the main branch and later create a new release. See https://github.com/luisllamasbinaburo/Arduino-MedianFilter/blob/v1.0.1/library.properties#L2

Uops! Sorry. Updated again

@ivankravets
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it works now.

@Blueforcer, you can use the semantic version (luisllamasbinaburo/MedianFilterLib@^1.0.1) now https://registry.platformio.org/libraries/luisllamasbinaburo/MedianFilterLib

Please sign in to comment.