First 10 Arduino Functions Every Beginner Should Know
You do not need to memorize every Arduino function. Start with these ten, and you can handle 90 percent of what you will write as a beginner.

When you first open the Arduino IDE, you see two empty functions: setup() and loop(). Everything you write builds on top of these. While Arduino offers hundreds of functions, you only need a handful to get started. These ten functions are the core foundation. Learn them, and you can build almost any beginner project.
pinMode()
The pinMode() function configures a digital pin to act as an input or an output. You must call it for each pin you use, typically inside setup(). A pin set to OUTPUT drives parts like LEDs or buzzers. A pin set to INPUT reads signals from buttons or sensors.
If you forget pinMode(), the pin defaults to INPUT. This is why an LED on an unconfigured pin will not light up. Arduino also has INPUT_PULLUP. This mode turns on an internal resistor, letting you connect buttons directly to ground without external components.
Recommended Project: If you want to see this function in action, check out our project page on building an LED with Buzzer Beep on Button Press, which walks you through configuring buttons and indicators using pinMode.
digitalWrite()
The digitalWrite() function sets an OUTPUT pin to HIGH or LOW. On 5V boards like the Arduino Uno, HIGH is 5V and LOW is 0V. On 3.3V boards, HIGH is 3.3V. If you call digitalWrite() on a pin that was not set to OUTPUT first, the instruction is ignored. This common mistake leaves beginners wondering why their working code does nothing.
You will use digitalWrite() to turn LEDs on or off, trigger buzzers, and control relays.
Recommended Project: You can see how this function is used to coordinate complex output states in our tutorial for building an Arduino Uno 7-Segment Countdown Buzzer.
digitalRead()
The digitalRead() function checks the voltage on an INPUT pin and returns HIGH or LOW. On 5V boards, signals above 3.0V read as HIGH, while signals below 1.5V read as LOW. Voltages between these levels are undefined. A disconnected pin will float, returning random values due to background noise.
Use digitalRead() to detect button presses, switches, or digital sensor signals. Combined with INPUT_PULLUP, a button reads HIGH when open and LOW when pressed.
Recommended Project: A great way to practice reading digital inputs is to build our Arduino Uno Tilt Alarm Box, which uses digitalRead to detect changes from a physical tilt switch.
analogRead()
The analogRead() function measures variable voltage on an analog pin, returning a number from 0 to 1023. The Arduino Uno uses a 10-bit converter to scale voltages relative to its supply voltage (usually 5V). Each step represents about 4.88 millivolts. The conversion takes about 100 microseconds, allowing up to 10,000 readings per second.
Use analogRead() with potentiometers, light sensors, or temperature sensors. If you run out of digital pins, analog pins A0 through A5 can also be configured as digital pins.
Recommended Project: To see a practical application of continuous analog sampling, check out our guide on creating an Arduino Uno Heartbeat BPM Monitor, which reads micro-volt variations from an optical sensor.
analogWrite()
Despite the name, analogWrite() does not output a true analog voltage. Instead, it outputs a Pulse-Width Modulation (PWM) signal. The value ranges from 0 (always LOW) to 255 (always HIGH). A value of 128 creates a square wave that is on for half the time, which dims an LED to roughly half brightness.
On the Uno, only pins 3, 5, 6, 9, 10, and 11 support PWM. To get a smooth, true analog voltage from a PWM pin, you must add an external low-pass filter circuit.
delay()
The delay() function pauses your program for a set number of milliseconds. This blocking function is the simplest way to add timing. However, the processor cannot read sensors, detect button presses, or process serial data during a delay.
While fine for basic blinking sketches, blocking delays cause issues in complex projects. The maximum delay value is roughly 49 days.
Recommended Project: You can see delay() used for pacing timing sequences in our melody project: Arduino Uno Buzzer Happy Birthday Melody.
millis()
The millis() function returns the milliseconds elapsed since the program started. It returns an unsigned long value and resets to zero after about 50 days. Unlike delay(), millis() is non-blocking. You can use it to track intervals without stopping the processor.
This enables the "blink-without-delay" pattern, which keeps your program responsive. By comparing the current millis() with a saved timestamp, you can trigger events while continuing to run other code.
Recommended Project: To practice non-blocking timing, build our Arduino Uno Mini Stopwatch, which uses millis() to track time dynamically without halting display updates.
Serial.begin() and Serial.println()
The Serial.begin() function opens serial communication at a specific baud rate, typically 9600. The Uno uses pins 0 and 1 to talk to your computer over the USB cable. This lets you send data from the board directly to your screen.
The Serial.println() function sends text or numbers followed by a new line. It converts variables to readable text automatically. These functions are your best debugging tools. Print sensor readings or variable states to see exactly what your board is doing.
Recommended Project: Try building the Arduino Uno Heartbeat BPM Monitor, which relies heavily on serial communication to print heart rate calculations directly to your computer.
map()
The map() function scales a value from one range to another. The syntax is map(value, fromLow, fromHigh, toLow, toHigh). Note that map() does not limit the output to the target range. If your input exceeds the source range, the output will exceed the target range unless you use the constrain() function.
The most common use is scaling an analog input (0-1023) down to a PWM output (0-255). The function uses integer math for speed, so it discards decimals rather than rounding.
Putting It Together
Combining these ten functions gives you the power to build almost any beginner electronics project. You can manage pins, read inputs, drive outputs, control timing, and debug code. While the official reference has many more commands, most sketches rely on this core set.
Every maker starts with these basic building blocks. Once you master them, you will be ready to build responsive systems and explore advanced libraries.
I am a 21-year-old IoT enthusiast who loves microcontrollers and exploring new components. I built IoTSimulator to help beginners learn without needing a pile of hardware.



