Right now taking the median of three numbers on the arduino involves including the entire standard library and filling up 80% of the arduino's RAM. This seems a bit... excessive.
Can we make a simpler solution?
Ideally, it would be able to take the median of an arbitrary number of elements. But we can live with a solution that takes just three elements. We need a C++ function that, given an array[] of three floats, returns the median value.
Right now taking the median of three numbers on the arduino involves including the entire standard library and filling up 80% of the arduino's RAM. This seems a bit... excessive.
Can we make a simpler solution?
Ideally, it would be able to take the median of an arbitrary number of elements. But we can live with a solution that takes just three elements. We need a C++ function that, given an array[] of three floats, returns the median value.