This will close #36. Before, the rf_heart_rate_and_oxygen_saturation method allocates an_x and an_y on every call. With the default settings, this will allocate 800 bytes of RAM, reducing the number of other libraries that can be used. This is especially noticeable on the Arduino Uno, which only has 2KB of memory
I changed this to perform calculations (and modify) on two float arrays passed in the parameter. Although this goes against general programming paradigms, I believe this tradeoff is worth making to reduce memory usage.
This will close #36. Before, the
rf_heart_rate_and_oxygen_saturation
method allocatesan_x
andan_y
on every call. With the default settings, this will allocate 800 bytes of RAM, reducing the number of other libraries that can be used. This is especially noticeable on the Arduino Uno, which only has 2KB of memoryI changed this to perform calculations (and modify) on two float arrays passed in the parameter. Although this goes against general programming paradigms, I believe this tradeoff is worth making to reduce memory usage.