2014-05-04 07:40:51 -04:00
|
|
|
import pyb
|
|
|
|
|
2020-03-22 22:26:08 -04:00
|
|
|
if not hasattr(pyb, "DAC"):
|
|
|
|
print("SKIP")
|
2017-06-10 13:14:16 -04:00
|
|
|
raise SystemExit
|
2017-02-05 21:48:01 -05:00
|
|
|
|
2014-05-03 11:43:27 -04: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 08:25:55 -04:00
|
|
|
|
|
|
|
# test buffering arg
|
|
|
|
dac = pyb.DAC(1, buffering=True)
|
|
|
|
dac.write(0)
|