So the median filter code works, but the value is still not reliable? If so, you may need to median filter over a longer time period - perhaps including samples that you have previously taken.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I'm not sure I understand. 'Still floating'?
So the median filter code works, but the value is still not reliable? If so, you may need to median filter over a longer time period - perhaps including samples that you have previously taken.