Guten Abend,
ich arbeite im Moment an einem Wecker (eigentlich bin ich fertig, bis auf dieses Detail), wenn der Sound einmal abgespielt worden ist(über eine Box + geringem Widerstand (um die Lautstärke etwas zu reduzieren)) höhre ich noch so ein leises pippen was extrem nervig ist wenn man noch mal 5 min schlafen möchte, ich benutze folgenden Code für den Sound
void sound(){ //sound (play sound)
for (int thisNote = 0; thisNote < 8; thisNote++) {
// to calculate the note duration, take one second
// divided by the note type.
//e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
int noteDuration = 1000/noteDurations[thisNote];
tone(12, melody[thisNote],noteDuration);
// to distinguish the notes, set a minimum time between them.
// the note's duration + 30% seems to work well:
int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);
// stop the tone playing:
noTone(12);
if (weckermode==0){
if(digitalRead(btnMode)==HIGH){
snoozeval = snoozemax;
delay(100);
}}
}}
Jeedenfalaa funktioniert auch das auf Null setzen durch analogwrite nicht, da bekomm ich auch sofort ein leises Interferenc pippen
Vilen dank Fèr eure Hilfe bei Fragen einfach melden