0Pricing
Arduino & IoT Academy · Lektion

Warum Taster „prellen“

Sehen Sie die Fehlauslösungen, die ein Kontakt erzeugt.

Warum Taster „prellen“ ist eine kostenlose Arduino & IoT Academy-Lektion auf CoddyKit. Dies ist Lektion 1 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Arduino & IoT Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Arduino & IoT Academy-Kurs umfasst insgesamt 4 Lektionen.

Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.

One Press, Many Signals

You press a button once, but your Arduino may see several presses. This sneaky problem is called bounce, and it trips up almost every beginner. 😅

Inside a Push Button

A button is just two metal contacts that touch when you press. They feel solid to your finger, but at the microsecond level they are anything but.

Metal That Chatters

When the contacts meet, they physically vibrate for a few milliseconds before settling. Each tiny touch and break is a separate electrical event.

What the Pin Sees

During that vibration, the pin reads a burst of rapid HIGH-LOW flips instead of one clean change. Your code can count every flip as a press.

Why the Loop Catches It

Your loop() runs millions of times per second, far faster than the bounce settles. So it samples the noise again and again.

A Counter Gone Wild

Picture a counter that adds one per press. One real tap can jump it by three or four because of multiple false triggers.

if (digitalRead(BTN) == LOW) {
  count++;  // may fire several times per tap
}

It Happens on Release Too

Bounce strikes when you let go as well, not just when you press. Both edges of the signal can stutter and confuse your logic.

How Long It Lasts

Most bounce settles within about 5 to 20 milliseconds. It is brief, but to a fast microcontroller that is an eternity of noise.

Spot It Yourself

Print a message every time the pin goes LOW and tap once. Seeing several lines in the Serial Monitor proves bounce is real.

if (digitalRead(BTN) == LOW)
  Serial.println("pressed");

Hardware or Software Fix

You can tame bounce with a small capacitor in the circuit, or with timing logic in code. Software is cheaper and far more common.

The Core Idea

The fix is to wait briefly after the first change and ignore the rest. Confirm the button is truly stable before you act on it.

Quick Check

Let's confirm what causes a button to bounce.

Recap: Bounce Basics

You learned that a button's contacts bounce, sending noisy flips that fool fast code. Next you'll silence that noise with simple timing. 🎯

Häufig gestellte Fragen

Ist die Lektion „Warum Taster „prellen““ kostenlos?

Ja — der vollständige Text von „Warum Taster „prellen““ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Arduino & IoT Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Arduino & IoT Academy-Kurs umfasst insgesamt 4 Lektionen.

Was lerne ich in „Warum Taster „prellen““?

Sehen Sie die Fehlauslösungen, die ein Kontakt erzeugt. Du übst Arduino & IoT Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.

Brauche ich Erfahrung, um Arduino & IoT Academy zu starten?

Keine Vorkenntnisse erforderlich. Arduino & IoT Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 1 von 4.

Wie lange dauert die Lektion „Warum Taster „prellen““?

Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.

Kann ich in dieser Arduino & IoT Academy-Lektion Code schreiben und ausführen?

Ja. Jede Arduino & IoT Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.

Alle Lektionen in diesem Kurs

  1. Warum Taster „prellen“
  2. Mit millis() entprellen
  3. Einen Wert im EEPROM speichern
  4. Einen Zähler nach dem Reset behalten
← Zurück zu Arduino & IoT Academy