stopInterval()
Stops the timer previously set with setInterval().
setInterval(ms:long)
Calls the onTimer() event repeatedly after ms milliseconds.
print("Print Hello every 3 seconds...")
setInterval(3000)
def onTimer():
print("Hello")
stopTimer()
Stops the timer previously set with setTimer().
setTimer(ms:long)
Calls the onTimer() event once after ms milliseconds.
print("Print Hello in 3 seconds...")
setTimer(3000)
def onTimer():
print("Hello")
getEpoch()->long
Returns the current Epoch Unix timestamp or the one set with setEpoch().
This value is the number of seconds since January 1, 1970 at 00:00.
getEpoch() # => 1582226420
setEpoch(epoch:long)
Overwrites the time information retrieved from the Internet with a user-defined time information (Epoch Unix Timestamp).
setEpoch(1582226420)
getMillis()->int
Returns the current millisecond.
ms = getMillis()
getSecond()->int
Returns the current second or the second set with setTime().
s = getSecond()
getMinute()->int
Returns the current minute or the minute set with setTime().
m = getMinute()
getWeekDay()->int
Returns the current day of the week.
0 = Sunday 1 = Monday 2 = Tuesday 3 = Wednesday 4 = Thursday 5 = Friday 6 = Saturday
wd = getWeekDay()
getHour()->int
Returns the current hour or the hour set with setTime().
h = getHour()
getDay()->int
Returns the current day or the day set with setDate().
d = getDay()
getMonth()->int
Returns the current month or the month set with setDate().
m = getMonth()
getYear()->int
Returns the current year or the year set with setDate().
y = getYear()
setDate(d:int,m:int,y:int)
Overwrites the date retrieved from the Internet with a user-defined date.
d = day m = month y = year
setDate(31,12,1990)
setTime(h:int,m:int,s:int)
Overwrites the time retrieved from the Internet with a user-defined time.
h = hour m = minute s = second
setTime(23,59,55)
setTimeZone(tz:byte[])
Sets the time zone to be used for the time functions.
You can find all available time zones here
setTimeZone("CET-1CEST,M3.5.0,M10.5.0/3") # Europe/Zurich
delay(ms:long)
Pauses execution by ms milliseconds.
millis()->long
Returns the milliseconds since the last start of the Oxocard. Since the data type “long” has a limited memory size, an overflow occurs for approx. 49.71 days and millis() starts again at 0.