mirror of
https://github.com/JorjBauer/aiie.git
synced 2024-10-31 09:15:51 +00:00
basic speaker functionality (on/off).
This commit is contained in:
parent
b303a04d76
commit
bfa402104d
@ -22,7 +22,10 @@ void TeensySpeaker::toggle(uint32_t c)
|
|||||||
mixerValue = (toggleState ? 0x1FF : 0x00);
|
mixerValue = (toggleState ? 0x1FF : 0x00);
|
||||||
mixerValue >>= (16-g_volume);
|
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)
|
void TeensySpeaker::maintainSpeaker(uint32_t c, uint64_t runtimeInMicros)
|
||||||
|
Loading…
Reference in New Issue
Block a user