RTC Programming Guide
Development website
  • Initial page
  • Introduction
  • Initialization
  • Setting time and date
  • Setting Alarms
  • RTC Watchdog
  • Using RTC with hibernate
  • Unix / Epoch time
  • Code examples and extended information
  • API Changelog
Powered by GitBook
On this page
  • Initializing the RTC
  • Switching RTC off

Was this helpful?

Initialization

Before getting information from the RTC, the I2C bus has to be initialized.

Initializing the RTC

The function RTC.ON() powers the RTC up and initializes the I2C bus, used for communicating with the RTC. It reads from the RTC time, date and alarms, setting the corresponding variables.

It returns nothing and modifies no flag.

Example of use:

{‌
RTC.ON(); // Executes the init process‌
}

Switching RTC off

The function RTC.OFF() closes the I2C bus. The RTC is powered directly by the battery (even when Waspmote is off or in sleep mode), so there are no switches to cut power to this chipset. The RTC enters into a low-power state when it detects that no actions are required.

The function returns nothing and modifies no flag.

Example of use:

{‌
RTC.OFF();‌
}
PreviousIntroductionNextSetting time and date

Last updated 4 years ago

Was this helpful?