dac.py 247 Bytes
Newer Older
1
2
import pyb

3
4
5
6
7
if not hasattr(pyb, 'DAC'):
    print('SKIP')
    import sys
    sys.exit()

8
9
10
11
12
13
14
15
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)