It keeps the input at a stable HIGH or LOW state when the button is not pressed.
Duration of the online course: 3 hours and 38 minutes
New
Write your first Arduino Uno sketch and bring buttons, sensors, and LEDs to life in this free online course on C and C++ for beginners.
Arduino Programming for Beginners: C and C++ is a free online course that shows you how a few lines of code can make an electronic circuit respond to the world around it. Designed for beginners, the course uses the Arduino Uno to connect programming concepts with results you can see, hear, or measure. You start by getting familiar with the board and writing sketches in the Arduino IDE. As you work through the examples, you learn the difference between code that runs once when the board starts and code that keeps running as it waits for an input.
One of the first challenges is getting a button to behave the way you expect. You use the Serial Monitor to see what the board actually reads, then explore why an input pin can give unpredictable readings when a button is not pressed. Once the input is stable, you can make your sketch count button presses and use that count to decide what happens next. The video lessons and short exercises help you reason through each step, so you can predict what a sketch will do and spot where your assumptions differ from what the board reports.
As your sketches become more interactive, you move from reading a button with two states to working with sensors that return a range of values. You see how to translate a sensor reading into a brightness level for an LED and how a sketch can move a servo motor. A musical example shows why the order of values in an array matters: each tone needs to line up with its duration for the sketch to play the tune as intended. By the end, you will have a foundation in C and C++ for Arduino and a way to test your ideas one step at a time as you take on your own electronics or robotics projects.
Explore free online Arduino courses and learn to build smart electronics projects from scratch. Master Arduino programming, circuits, sensors, microcontrollers, and IoT through flexible, beginner-friendly lessons. Every course is free and includes a certificate, helping you develop practical skills, strengthen your resume, and start creating innovative Arduino projects today.
Explore free online C and C++ courses designed for beginners and aspiring developers. Learn programming fundamentals, pointers, memory management, object-oriented programming, data structures, and more at your own pace. Build practical coding skills with expert-led lessons, and earn a certificate with every completed course.
3 hours and 38 minutes of online video course
Digital certificate of course completion (Free)
Exercises to train your knowledge
100% free, from content to certificate
Why does an Arduino button need a pull-up or pull-down resistor?
It keeps the input at a stable HIGH or LOW state when the button is not pressed.
How can Arduino map a sensor reading to LED brightness?
Use map() to scale the reading to 0–255, then pass it to analogWrite() on a PWM pin.
Why use an interrupt for an Arduino button during long delays?
An interrupt can detect a button press while the main program is delayed.
Ready to get started?Download the app and get started today.
Install the app now
to access the courseOver 5,000 free courses
Programming, English, Digital Marketing and much more! Learn whatever you want, for free.
Study plan with AI
Our app's Artificial Intelligence can create a study schedule for the course you choose.
From zero to professional success
Improve your resume with our free Certificate and then use our Artificial Intelligence to find your dream job.
You can also use the QR Code or the links below.
Video Courses
Exercises
Test your ability to interpret Betaflight Blackbox logs, diagnose oscillations, evaluate filtering, and recognize PID-related flight issues.
Start exercisesTest your knowledge of UAV photogrammetry, including overlap, GSD, control points, camera settings, terrain following, and image quality.
Start exercisesTest your knowledge of FPV control links, antennas, signal metrics, receiver setup, interference, telemetry, and failsafe behavior.
Start exercisesEbooks and audiobooks
+ 10 million
students
Free and Valid
Certificate
60 thousand free
exercises
4.8/5 rating in
app stores
Free courses in
video and ebooks