Trying to use SystemSleepConfiguration and geting compile-time errors

I'm trying to code up Hibernate for the Boron LTE. I'm using the online IDE build.particle.io. When I try to compile the following code to Hibernate, I get errors that SystemSleepConfiguraiton, config and SystemSleepMode are not defined. I'm guessing that, like in the Arduino IDE, I need to include something. Can anyone tell me what I need to do in order for this to compile? Thank you

`

SystemSleepConfiguration config;

config.mode(SystemSleepMode::HIBERNATE).gpio(D8, FALLING);

System.sleep(config);

`

What does the rest of your code look like? If you are using the Web IDE and a .ino file you don't need to include anything. If you have a second tab open as a .cpp or .h file, you need to:

#include "Particle.h"

I figured out what the problem was. There is a legacy method of hibernation and a more current way (which is what I coded up). After a lot of searching, I found out that early versions of the OS firmware require the use of the legacy method, and to use the current method requires more current firmware. I upgraded the Boron to version 4.1.0 and the code I attempted to compile (above) now compiles and works.

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