ExternalWakeup / Does not work. help me.

Post here first, or if you can't find a relevant section!
Post Reply
myksj1105
Posts: 95
Joined: Sun Jun 18, 2023 11:35 am
Answers: 2

ExternalWakeup / Does not work. help me.

Post by myksj1105 »

ExternalWakeup / Does not work. help.

hello.

1. Reference link: https://github.com/stm32duino/STM32LowPower
2. MCU: STM32F103C8T6

Code: Select all

#include "STM32LowPower.h"
volatile int repetitions = 1;
#define BUZZER PB7

#ifndef USER_BTN 
#define USER_BTN pinNametoDigitalPin(SYS_WKUP1)
#endif
const int pin = USER_BTN;

void setup() {
  pinMode(pin, INPUT); pinMode(BUZZER, OUTPUT); 
  
  Serial.begin(115200);
  Serial.println("STEP-1");
  delay(10000); 
  Serial.println("STEP-2");

   tone(BUZZER,1000,100); delay(500);
  LowPower.begin();
  LowPower.attachInterruptWakeup(pin, repetitionsIncrease, CHANGE, DEEP_SLEEP_MODE); // SLEEP_MODE
}

void loop() {
  tone(BUZZER,1000,100); delay(1000);  
  LowPower.deepSleep();  
}

void repetitionsIncrease() {
  repetitions ++;
}

Q1) Is the pin corresponding to ‘SYS_WKUP1’ ‘PA0’?
Q2) ‘Wake up’ does not work after operation 1.
help.
by myksj1105 » Wed Jun 12, 2024 1:40 am

Code: Select all

const int pin = PA0;
I changed it to and it works.
Go to full post
myksj1105
Posts: 95
Joined: Sun Jun 18, 2023 11:35 am
Answers: 2

Re: ExternalWakeup / Does not work. help me.

Post by myksj1105 »

Code: Select all

const int pin = PA0;
I changed it to and it works.
Post Reply

Return to “General discussion”