tests, pyb: Add 'import pyb' when needed.
This commit is contained in:
parent
c327c0de5d
commit
cda363a036
@ -1,3 +1,5 @@
|
|||||||
|
import pyb
|
||||||
|
|
||||||
accel = pyb.Accel()
|
accel = pyb.Accel()
|
||||||
print(accel)
|
print(accel)
|
||||||
accel.x()
|
accel.x()
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import pyb
|
||||||
|
|
||||||
dac = pyb.DAC(1)
|
dac = pyb.DAC(1)
|
||||||
print(dac)
|
print(dac)
|
||||||
dac.noise(100)
|
dac.noise(100)
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import pyb
|
||||||
|
|
||||||
ext = pyb.ExtInt('X1', pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_DOWN, lambda l:print('line:', l))
|
ext = pyb.ExtInt('X1', pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_DOWN, lambda l:print('line:', l))
|
||||||
ext.disable()
|
ext.disable()
|
||||||
ext.enable()
|
ext.enable()
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import pyb
|
||||||
from pyb import I2C
|
from pyb import I2C
|
||||||
|
|
||||||
i2c = I2C(1)
|
i2c = I2C(1)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import pyb
|
||||||
from pyb import LED
|
from pyb import LED
|
||||||
|
|
||||||
for i in range(4):
|
for i in range(4):
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
|
import pyb
|
||||||
from pyb import RTC
|
from pyb import RTC
|
||||||
|
|
||||||
rtc = RTC()
|
rtc = RTC()
|
||||||
print(rtc)
|
print(rtc)
|
||||||
rtc.datetime((2014, 1, 1, 1, 0, 0, 0, 0))
|
rtc.datetime((2014, 1, 1, 1, 0, 0, 0, 0))
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from pyb import Switch
|
from pyb import Switch
|
||||||
|
|
||||||
sw = pyb.Switch()
|
sw = Switch()
|
||||||
print(sw())
|
print(sw())
|
||||||
sw.callback(print)
|
sw.callback(print)
|
||||||
sw.callback(None)
|
sw.callback(None)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import pyb
|
||||||
from pyb import Timer
|
from pyb import Timer
|
||||||
|
|
||||||
tim = Timer(4)
|
tim = Timer(4)
|
||||||
|
Loading…
Reference in New Issue
Block a user