Skip to content

Commit d644240

Browse files
committed
docs: Fix formatting of DAC code examples.
1 parent b5c43be commit d644240

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/library/pyb.DAC.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ To output a continuous sine-wave::
2626
# create a buffer containing a sine-wave
2727
buf = bytearray(100)
2828
for i in range(len(buf)):
29-
buf[i] = 128 + int(127 \* math.sin(2 \* math.pi \* i / len(buf)))
29+
buf[i] = 128 + int(127 * math.sin(2 * math.pi * i / len(buf)))
3030

3131
# output the sine-wave at 400Hz
3232
dac = DAC(1)
33-
dac.write_timed(buf, 400 \* len(buf), mode=DAC.CIRCULAR)
33+
dac.write_timed(buf, 400 * len(buf), mode=DAC.CIRCULAR)
3434

3535
To output a continuous sine-wave at 12-bit resolution::
3636

@@ -43,7 +43,7 @@ To output a continuous sine-wave at 12-bit resolution::
4343

4444
# output the sine-wave at 400Hz
4545
dac = DAC(1, bits=12)
46-
dac.write_timed(buf, 400 \* len(buf), mode=DAC.CIRCULAR)
46+
dac.write_timed(buf, 400 * len(buf), mode=DAC.CIRCULAR)
4747

4848
Constructors
4949
------------

0 commit comments

Comments
 (0)