Super Simple RTC

Post your cool example code here.
User avatar
Posts: 7680
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia

Re: Super Simple RTC

Post by RogerClark » Mon Sep 26, 2016 9:23 pm


I recommend the ID107HR as it has touch button on the front as well as a real button on the side. I paid around $18 USD including postage, (on AliExpress)

Just make sure the description includes nRF51822 as a lot of these are miss-sold.

I have everything working on it except the heart rate detection

User avatar
Posts: 2193
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta

Re: Super Simple RTC

Post by mrburnette » Sat Oct 01, 2016 6:08 pm

neo2121 wrote:No extra libraries are required, just the RTClock library that comes with stm32duino.
From some of my example stuff from the dark ages of STM32... modified today to work with the Blue Pill. The example just counts seconds...

Code: Select all

  Using library RTClock at version 1.0 in folder: /home/ray/Arduino/hardware/Arduino_STM32-TMRPCM-and-example-/STM32F1/libraries/RTClock 
  Linux Mint 17.3 64-bit ArduinoGUI 1.6.11
    Sketch uses 18,436 bytes (14%) of program storage space. Maximum is 131,072 bytes.
    Global variables use 3,904 bytes of dynamic memory.

#include <RTClock.h>

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

#define LED_PIN PC13                // Blueboard

// This function is called in the attachSecondsInterrpt
void blink () 

void setup() 
  pinMode(LED_PIN, OUTPUT);
  Serial.println("Initializing... \n\r");
  rt.attachSecondsInterrupt(blink); // Call blink @ 1 second intervals

void loop() 
  if (rt.getTime()!=tt)             // do nothing while seconds are ==
    tt = rt.getTime();              // update to new second count
    Serial.print("seconds count is: ");
    Serial.println(tt);             // tell Operator the second count

Posts: 1
Joined: Sun Mar 26, 2017 2:51 am

Re: Super Simple RTC

Post by simonliu009 » Sun Mar 26, 2017 2:57 am

wow, thank you very much for this.

Post Reply