2018-02-28 00:12:23 +01:00
|
|
|
# @extends
|
|
|
|
|
|
|
|
## Example #example
|
|
|
|
|
2020-11-06 22:09:53 +01:00
|
|
|
Use a wait and the timer to generate a number.
|
2018-02-28 00:12:23 +01:00
|
|
|
|
|
|
|
```blocks
|
2020-11-06 22:09:53 +01:00
|
|
|
let something = 0
|
2018-02-28 00:12:23 +01:00
|
|
|
for (let i = 0; i < 100; i++) {
|
|
|
|
control.waitMicros(100)
|
2020-11-06 22:09:53 +01:00
|
|
|
something = control.millis()
|
|
|
|
something += control.deviceSerialNumber()
|
|
|
|
if (something != 0) {
|
|
|
|
something = something / 1000000
|
2018-02-28 00:12:23 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|