From 86decffbb12e3bf97b1147f7a652a6c6cc37fa36 Mon Sep 17 00:00:00 2001 From: Jorj Bauer Date: Tue, 28 Feb 2017 17:51:07 -0500 Subject: [PATCH] removed averaging; just mixing --- teensy/teensy-speaker.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/teensy/teensy-speaker.cpp b/teensy/teensy-speaker.cpp index c736977..381b448 100644 --- a/teensy/teensy-speaker.cpp +++ b/teensy/teensy-speaker.cpp @@ -28,18 +28,11 @@ void TeensySpeaker::maintainSpeaker(uint32_t c) needsToggle = false; } - mixerValue += (toggleState ? 0xFFF : 0x00); - // FIXME: Temporarily disabling mixer - /* numMixed += 2; - - if (numMixed > 1) { - mixerValue /= numMixed; - }*/ - - // FIXME: glad it's DAC0 and all, but... how does that relate to the pin passed in the constructor? + mixerValue += (toggleState ? 0x1FF : 0x00); mixerValue >>= (16-g_volume); + // FIXME: glad it's DAC0 and all, but... how does that relate to the pin passed in the constructor? analogWriteDAC0(mixerValue); }