.setdata Method

Function:

Presets the RTC with a number of elapsed days , minutes , and seconds.

Syntax:

rtc.setdata(daycount as word, mincount as word, seconds as byte)

Returns:

---

See Also:

rtc. Object


Part

Description

daycount

Number of elapsed days.

mincount

Number of elapsed minutes.

seconds

Number of elapsed seconds.


Details

Most platforms include a set of convenient date and time conversion functions that can be used to transform the actual date into "elapsed time" values (see daycount and mincount).

A warning note icon.Note that after the device powers up, and provided that the backup power was not present at all times, the RTC may be in the undetermined state and not work properly until the rtc.setdata method is executed at least once. Incorrect behavior may include failure to increment or incrementing at an abnormal rate. The rtc.running read-only property cannot be used to reliably check the RTC state in this situation.

It is not necessary to use rtc.setdata if the backup power was present at all times while the device was off.

A tip note icon.With Tibbo BASIC/C release V2, this method had to be renamed from .set to .setdata. This is because the period (".") separating "rtc" from "setdata" is now a "true" part of the language (i.e., it is recognized as a syntax unit, not just part of identifier). Hence, Tibbo BASIC and C see "rtc" and "set" as separate entities and "set" is a reserved word that can't be used.


.setdata Method

Details