Go Down

Topic: MKRFox1200 issue on setting GPIO pin to HIGH on wake up (Read 1 time) previous topic - next topic

nimasa

Hello,
I programmed MKRFox1200 to go into deep sleep mode and set a GPIO pin HIGH (Pin 6) when it wakes up every 1 minute. But the GPIO pin is not turning to HIGH. I tried with delay() instead of LowPower.sleep() and it worked. So the problem exists only when the board is operating in deep sleep mode.

Does anyone have a clue if it's even possible to turn a GPIO pin to HIGH on waking up from deep sleep mode? and if so, how to do it?


Following is a simplified code that I'm using

Code: [Select]
#include <SigFox.h>
#include <ArduinoLowPower.h>

void setup() {
  pinMode(6,OUTPUT); // <<<<
 
  if (!SigFox.begin()) {
    reboot();
  }
  SigFox.end();
  LowPower.attachInterruptWakeup(RTC_ALARM_WAKEUP, dummy, CHANGE);
}

void loop() {
  digitalWrite(6,HIGH);  // <<<<
  delay(5000);          // <<<<
  digitalWrite(6,LOW); // <<<<

  SigFox.begin();
  delay(100);
  SigFox.beginPacket();
  SigFox.print("something");
  int ret = SigFox.endPacket();
  SigFox.end();

  //delay(0.25*60*1000);
  LowPower.sleep(1 * 60 * 1000);
}

void reboot() {
  NVIC_SystemReset();
  while (1);

}

void dummy() {
  volatile int ttt = 0;
}


Thanks in advance


Go Up