From the course: Learning Arduino: Foundations
Unlock the full course today
Join today to access over 23,500 courses taught by industry experts.
pinMode() - Arduino Tutorial
From the course: Learning Arduino: Foundations
pinMode()
- [Instructor] Now let's try to understand some of the main commands used with an Arduino IDE. You can use each digital interface on the Arduino as either input or an output, but not both at the same time. Now, in order to tell Arduino which mode your sketch uses for the specific digital or analog interface, we need to use pinMode function. In pinMode function, we basically configure at the specific pin in Arduino to behave either as an input or an output. This is the way the function is written. The pinMode function requires two parameters. The pin parameter determines the pin member to configure. The mode parameter determines whether the pen operates as an input or an output. There are three values you can use for the interface mode setting. INPUT in order to set it for a normal input mode, INPUT_PULLUP is in order to set it for an input mode, but uses an internal pull-up resistor. I'll talk more about this later in…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Download the Arduino software39s
-
(Locked)
A tour of the Arduino IDE4m 1s
-
(Locked)
The setup() and loop() functions1m 17s
-
(Locked)
pinMode()2m 11s
-
(Locked)
digitalWrite()1m 33s
-
(Locked)
Creating your first sketch3m 32s
-
(Locked)
Serial Monitor1m 52s
-
(Locked)
Testing blink LED and Serial Monitor2m 32s
-
(Locked)
-
-
-