@ adafruit2

The plotting vertical axis numbers in Makecode match the data point values!

The values of the data points of samples(i) - mean are couple of orders of magnitude smaller in Makecode than in MU.

In the original CircuitPython code there were a few statements converting integers to floating point.

I am refering to oversample += float(light.value) and mean = sum(samples) / float(len(samples))

In Makecode there are integer divide and multiply blocks under math --> square root but no float.

How do I convert an integer to floating point in Makecode?