Update CircuitPython_I2S_Tone.py

fixed trailing white space issue
This commit is contained in:
papahabla 2019-02-26 10:19:34 -08:00 committed by GitHub
parent b4824003f6
commit 1cddf91478
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,7 +11,7 @@ frequency = 440 # Set this to the Hz of the tone you want to generate.
length = sample_rate // frequency # One freqency period
sine_wave = array.array("H", [0] * length)
for i in range(length):
sine_wave[i] = int((math.sin(math.pi * 2 * frequency * i / sample_rate) *
sine_wave[i] = int((math.sin(math.pi * 2 * frequency * i / sample_rate) *
tone_volume + 1) * (2 ** 15 - 1))
# For Feather M0 Express, ItsyBitsy M0 Express, Metro M0 Express