Unlocking the Power of Photon 2: Mastering Retained Memory and Analog Readings

The team at Particle has announced that the Photon 2 offers limited support for retained memory. This might refer to the specific amount of space allocated for retaining data, maybe?

The previous Photon model required a battery to maintain data in retained memory.
In contrast, the Photon 2 does not need a battery for this purpose. It can keep the retained data intact, even if you power it off completely.

As usually, just add the STARTUP(System.enableFeature(FEATURE_RETAINED_MEMORY));
to your code. This enables the retained memory feature.

After enabling the feature, declare the variables you want to retain. It's as simple as that!

Another interesting detail is the analog readings. Basically the Photon 2 is right on the spot! All good from 0V all the way to 3.3V!

1 Like

The problem is that retained memory is not preserved on system reset on RTL872x platforms.

In Device OS 3.3.0 and later there are several workarounds in Device OS so that in many cases, it will be saved and reloaded at boot, however you should read the caveats to make sure it will work in your situation.

It's explained on this page.

3 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.