2014-05-04 12:40:51 +01:00
|
|
|
import pyb
|
|
|
|
|
2020-03-23 02:26:08 +00:00
|
|
|
if not hasattr(pyb, "DAC"):
|
|
|
|
print("SKIP")
|
2017-06-10 18:14:16 +01:00
|
|
|
raise SystemExit
|
2017-02-06 02:48:01 +00:00
|
|
|
|
2014-05-03 16:43:27 +01:00
|
|
|
dac = pyb.DAC(1)
|
|
|
|
print(dac)
|
|
|
|
dac.noise(100)
|
|
|
|
dac.triangle(100)
|
|
|
|
dac.write(0)
|
|
|
|
dac.write_timed(bytearray(10), 100, mode=pyb.DAC.NORMAL)
|
|
|
|
pyb.delay(20)
|
|
|
|
dac.write(0)
|
2018-04-10 13:25:55 +01:00
|
|
|
|
|
|
|
# test buffering arg
|
|
|
|
dac = pyb.DAC(1, buffering=True)
|
|
|
|
dac.write(0)
|