Merge pull request #2965 from jepler/sine-wave-examples
Various doc examples: Fix the "/ 18" copypasta bug
This commit is contained in:
commit
f72d166e51
@ -61,7 +61,7 @@
|
|||||||
//| length = 8000 // 440
|
//| length = 8000 // 440
|
||||||
//| sine_wave = array.array("H", [0] * length)
|
//| sine_wave = array.array("H", [0] * length)
|
||||||
//| for i in range(length):
|
//| for i in range(length):
|
||||||
//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15)
|
//| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15)
|
||||||
//|
|
//|
|
||||||
//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000)
|
//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000)
|
||||||
//| i2s = audiobusio.I2SOut(board.D1, board.D0, board.D9)
|
//| i2s = audiobusio.I2SOut(board.D1, board.D0, board.D9)
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
//| length = 8000 // 440
|
//| length = 8000 // 440
|
||||||
//| sine_wave = array.array("h", [0] * length)
|
//| sine_wave = array.array("h", [0] * length)
|
||||||
//| for i in range(length):
|
//| for i in range(length):
|
||||||
//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15))
|
//| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15))
|
||||||
//|
|
//|
|
||||||
//| dac = audioio.AudioOut(board.SPEAKER)
|
//| dac = audioio.AudioOut(board.SPEAKER)
|
||||||
//| sine_wave = audiocore.RawSample(sine_wave)
|
//| sine_wave = audiocore.RawSample(sine_wave)
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
//| length = 8000 // 440
|
//| length = 8000 // 440
|
||||||
//| sine_wave = array.array("H", [0] * length)
|
//| sine_wave = array.array("H", [0] * length)
|
||||||
//| for i in range(length):
|
//| for i in range(length):
|
||||||
//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15)
|
//| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15)
|
||||||
//|
|
//|
|
||||||
//| dac = audioio.AudioOut(board.SPEAKER)
|
//| dac = audioio.AudioOut(board.SPEAKER)
|
||||||
//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000)
|
//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000)
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
//| length = 8000 // 440
|
//| length = 8000 // 440
|
||||||
//| sine_wave = array.array("H", [0] * length)
|
//| sine_wave = array.array("H", [0] * length)
|
||||||
//| for i in range(length):
|
//| for i in range(length):
|
||||||
//| sine_wave[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15)
|
//| sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15)
|
||||||
//|
|
//|
|
||||||
//| dac = audiopwmio.PWMAudioOut(board.SPEAKER)
|
//| dac = audiopwmio.PWMAudioOut(board.SPEAKER)
|
||||||
//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000)
|
//| sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000)
|
||||||
|
Loading…
Reference in New Issue
Block a user