summaryrefslogtreecommitdiffstatshomepage
path: root/tests/pybnative/while.py
blob: 3ea7221ea706a3189dde3cfc4677763682c92bab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import pyb

@micropython.native
def f(led, n, d):
    led.off()
    i = 0
    while i < n:
        print(i)
        led.toggle()
        pyb.delay(d)
        i += 1
    led.off()

f(pyb.LED(1), 2, 150)
f(pyb.LED(2), 4, 50)