0Pricing
Arduino & IoT Academy · Lektion

pinMode und OUTPUT

Legen Sie fest, dass ein Pin Strom zu einer LED liefert

pinMode und OUTPUT 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.

Pins Have a Job

Every Arduino pin can either listen or speak. Before you use one, you must tell it which job to do. That setup is the role of pinMode. 🔌

Why OUTPUT Mode

To light an LED, the pin must send current out into the world. You declare that intent by setting the pin to OUTPUT mode.

The pinMode Call

You configure a pin once, inside setup(). The pinMode function takes a pin number and a mode, and it remembers your choice.

pinMode(13, OUTPUT);

Naming Your Pin

Hard-coded numbers get confusing fast. Give the pin a clear name with a constant so your sketch reads like plain language.

const int ledPin = 13;

Set It Up Once

You only need to declare a pin's mode a single time. Put pinMode in setup(), which runs once when the board powers on.

void setup() {
  pinMode(ledPin, OUTPUT);
}

The Onboard LED

Pin 13 is special: most Arduino boards wire it to a tiny onboard LED. That means you can test output with no extra parts. 💡

A Friendlier Alias

You do not have to memorize the number. Arduino gives you the built-in name LED_BUILTIN, which points to that onboard LED for you.

pinMode(LED_BUILTIN, OUTPUT);

OUTPUT vs INPUT

Each pin defaults to listening. Setting OUTPUT flips it so the pin actively drives a voltage instead of just sensing one.

What 'Drive' Means

An OUTPUT pin can push out about 5 volts or pull down to 0. That controlled push is how a pin drives an LED on or off.

Forgetting pinMode

Skip pinMode and your LED may stay dim or dead. The pin never enters OUTPUT mode, so it cannot push enough current to shine.

Setup Is the Stage

Think of setup() as preparing the stage before the show. Declaring your pin's mode here gets everything ready for the loop that follows.

Quick Check

You want a pin to light an LED. What do you call first?

Recap

You learned to claim a pin with pinMode and OUTPUT inside setup(). With the pin ready to drive current, you can now make it blink. 🎉

Häufig gestellte Fragen

Ist die Lektion „pinMode und OUTPUT“ kostenlos?

Ja — der vollständige Text von „pinMode und OUTPUT“ 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 „pinMode und OUTPUT“?

Legen Sie fest, dass ein Pin Strom zu einer LED liefert 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 „pinMode und OUTPUT“?

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. pinMode und OUTPUT
  2. digitalWrite HIGH und LOW
  3. delay() und Blinkintervalle
  4. Eine externe LED sicher anschließen
← Zurück zu Arduino & IoT Academy