How was it that I could alternate the pins to make it louder?
Code: Select all
import pwmio
# Create piezo buzzer PWM output.
buzzer0 = pwmio.PWMOut(board.A1, variable_frequency=True)
buzzer1= pwmio.PWMOut(board.A3, variable_frequency=True)
# Make sound for 3 seconds
for i in range(3):
buzzer0.frequency = 440
buzzer0.duty_cycle = 2**15
buzzer1.frequency = 440
buzzer1.duty_cycle = 0
time.sleep(1)