stm32duino / STM32RTC

Arduino RTC library for STM32.
127 stars 48 forks source link

Call Interrupt every second #24

Closed ghost closed 4 years ago

ghost commented 4 years ago

I need to call an interrupt 1 time per second. Can you give an example of how to do this? In the library there are only examples for interruption for a specific time (for example: 07:25:00). I need interruption to happen every second. as an example, there is an RTClock library, but this library does not work on this kernel. There is a command in this library: `#include

RTClock rt (RTCSEL_LSE); // initialise uint32 tt;

void SecondsInterrupt() // This function is called in the attachSecondsInterrpt { // some code }

void setup() { rt.attachSecondsInterrupt(SecondsInterrupt);// Call SecondsInterrupt }` Is there something similar in the STM32RTC library? Please help me with an example.

fpistm commented 4 years ago

Please, use the forum https://www.stm32duino.com for such question/support request.

Anyway, You should use a timer for this. See the HardwareTimer library in the wiki.