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.
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
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)
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)
getYear()->int
Returns the current year or the year set with setDate().
y = getYear()
getMonth()->int
Returns the current month or the month set with setDate().
m = getMonth()
getDay()->int
Returns the current day or the day set with setDate().
d = getDay()
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()
getMinute()->int
Returns the current minute or the minute set with setTime().
m = getMinute()
getSecond()->int
Returns the current second or the second set with setTime().
s = getSecond()
getMillis()->int
Returns the current millisecond.
ms = getMillis()
setEpoch(epoch:long)
Overwrites the time information retrieved from the Internet with a user-defined time information (Epoch Unix Timestamp).
setEpoch(1582226420)
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
setTimer(ms:long)
Calls the onTimer() event once after ms milliseconds.
print("Print Hello in 3 seconds...")
setTimer(3000)
def onTimer():
print("Hello")
stopTimer()
Stops the timer previously set with setTimer().
setInterval(ms:long)
Calls the onTimer() event repeatedly after ms milliseconds.
print("Print Hello every 3 seconds...")
setInterval(3000)
def onTimer():
print("Hello")
stopInterval()
Stops the timer previously set with setInterval().
getSystemTime()->long
Returns the number of microseconds since the system was started.
ns = getSystemTime()
delay(10)
print getSystemTime() - ns
1 microsecond = 0.000001 seconds.