Skip to content

Back up importing not working as intended #31

@tekktrik

Description

@tekktrik

Fix inbound shortly, just a placeholder so I don't forget - but basically I think the import logic doesn't reflect the intent of allowing pwmio if audioio isn't available , since my QTPy-ESP32-S2 should be able to use this library with pwmio but the current import structure doesn't allow it. It seems like it should only tell the user to add adafruit_waveform if audioio is detected by adafruit_waveform is not based on the logic here:

if AUDIOIO_AVAILABLE:
wave, min_freq = _get_wave(tune, octave)
try:
# AudioOut interface changed in CP 3.x; a waveform if now pass
# directly to .play(), generated for each note in _play_to_pin()
if sys.implementation.version[0] >= 3:
base_tone = audioio.AudioOut(pin)
else:
base_tone = audioio.AudioOut(pin, wave)
except ValueError:
# No DAC on the pin so use PWM.
pass
# Fall back to PWM
if not base_tone:
base_tone = pwmio.PWMOut(pin, duty_cycle=0, variable_frequency=True)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions