System functions (time, random numbers)
Loading...
Loading...
Loading...
Loading...
Wait for time by polling (specified in μsec).
It is not included in MWSDK2020_05. Supported packages will be MWSDK_2020_07_UNOFFICIAL or later.
Wait for time by polling (specified in μsec).
Wait for a given period of time in microsec
.
The time is measured by the TickTimer count. When waiting for a long time, the CPU clock is reduced and polling is performed.
In the setup(), wakeup()
function, TickTimer is not yet running, so it waits for a while in a while loop. In this case, the error with the specified value will be large. This loop counter is adjusted to 32Mhz. If the CPU clock is changed in these functions, the error will be proportional to the clock.
If you specify a short time, such as less than 10 for a parameter, the error may be large.
Obtain the system time, [ms].
Obtain the system time, [ms].
The system tick time is updated by TickTimer interrupt.
Waiting for time by polling.
Waiting for time by polling.
The program waits for a given period of time in ms
.
The time is measured by the TickTimer count. When waiting for a long period of time, the CPU clock is decreased and polling is performed.
Every 5ms after calling delay()
, TWELITE microcontroller performs internal watchdog processing.
For example, if you execute while(1) delay(1);
, the watchdog processing is not performed because 5ms does not elapse inside delay()
, and the reset is executed after a certain time.
In the setup(), wakeup()
function, the TickTimer is not yet running, so it waits for a time by a while loop. In this case, the error with the specified value will be large. This loop counter is adjusted to 32Mhz. If the CPU clock is changed in these functions, the error will be proportional to the clock.
If you specify a short time, such as 1 or 2 as a parameter, the error may be large.
Generates an random number.
Generates an random number.
The first line returns the value of 0.. (maxval-1)
value is returned. Note that the value of maxval is not the maximum value.
The second line returns the value of minval..maxval-1
.