basic speaker functionality (on/off).

This commit is contained in:
Jorj Bauer 2020-07-08 09:43:44 -04:00
parent b303a04d76
commit bfa402104d
1 changed files with 5 additions and 2 deletions

View File

@ -21,8 +21,11 @@ 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)