CubeCell Sleep mode with GPIO

I used the CubeCell Deep Sleep Mode Wakeup with GPIO program example and added the TX program example , however it is not sleeping after 6 MCU cycles.

Here is the portion of code that caused the issue:
void loop() {
if(lowpower){
//note that lowPowerHandler() runs six times before the mcu goes into lowpower mode;
lowPowerHandler();
}
// put your main code here, to run repeatedly:
//*********************************************************************************
Serial.printf(“woken up - with just this stops at 6 mcu cycles\r\n”);
//delay(10);

//****************************************************************************************************************
//When I add this portion - will not go to sleep after 6 MCU cycles

//txNumber += 0.01;
txNumber += 1;
sprintf(txpacket,"%s",“Hello world number”); //start a package
// sprintf(txpacket+strlen(txpacket),"%d",txNumber); //add to the end of package

DoubleToString(txpacket,txNumber,3); //add to the end of package

turnOnRGB(COLOR_SEND,0); //change rgb color

Serial.printf("\r\nsending packet “%s” , length %d\r\n",txpacket, strlen(txpacket));

Radio.Send( (uint8_t *)txpacket, strlen(txpacket) ); //send the package out

//**************************************************************************************************************

}

lowPowerHandler() runs six times before the mcu goes into low-power mode without other code in between.

Your code run lowPowerHandler() followed by many things, It will not sleep.
You can try while(lowpower) to force it to run at least 6 times without any code disrupt it.

Hi ksckung,

That worked!

Thanks very much for your help.