basic speaker functionality (on/off).

This commit is contained in:
Jorj Bauer 2020-07-08 09:43:44 -04:00
parent b303a04d76
commit bfa402104d

View File

@ -22,7 +22,10 @@ void TeensySpeaker::toggle(uint32_t c)
mixerValue = (toggleState ? 0x1FF : 0x00);
mixerValue >>= (16-g_volume);
analogWrite(speakerPin, mixerValue);
// FIXME: this is one helluva hack
if (g_volume >= 8)
digitalWrite(speakerPin, toggleState ? HIGH : LOW);
//analogWrite(speakerPin, mixerValue);
}
void TeensySpeaker::maintainSpeaker(uint32_t c, uint64_t runtimeInMicros)