Video summary
ARDUINO TUTORIAL SERIES MENGGUNAKAN TINKERCAD: DIGITAL INPUT - PUSH BUTTON
Main summary
Key takeaways
Summary
The video demonstrates how to read a push button as a digital input in an Arduino simulation using Tinkercad. The Arduino reads the button’s state as either HIGH (1) or LOW (0) and uses it to control an LED.
Circuit setup
- Add an Arduino Uno, an LED, a resistor, and a push button in Tinkercad.
- Connect the LED’s negative leg through a resistor to GND.
- Connect the LED’s positive leg to digital pin 12.
- Connect one side of the push button to digital pin 11 and the other side to GND.
- Use the Arduino’s internal pull-up resistor. With this setup, the button reads HIGH when released and LOW when pressed.
Coding and behavior
The presenter switches from block-based coding to the text editor and writes an Arduino sketch in C++:
- Declare variables for the button state, LED pin (12), and button pin (11).
- In
setup():- Set the LED pin as
OUTPUT. - Set the button pin to
INPUT_PULLUPto enable the Arduino’s internal pull-up resistor.
- Set the LED pin as
- In
loop():- Read the button with
digitalRead()and store the result in the button-state variable. - If the state is
LOW, set the LED pin toHIGHto turn the LED on. - Otherwise, set the LED pin to
LOWto turn the LED off.
- Read the button with
Because the input uses INPUT_PULLUP, the logic is inverted from what beginners might expect: released = HIGH (1) and pressed = LOW (0). The LED therefore lights while the button is pressed.
The presenter also notes that C++ is case-sensitive, so variable names must use the same capitalization wherever they appear.
Checking the input with the Serial Monitor
To verify the readings, the presenter adds Serial.begin(9600) in setup() and prints the button-state variable using a serial command. The Serial Monitor shows 1 when the button is released and 0 when it is pressed, matching the circuit’s behavior.
Speakers or sources featured
- A single, unnamed narrator/instructor.
- No other speakers or external sources are featured.
Rate this summary
Your feedback will help improve summaries.
Improve this summary
Reprocess with a stronger model when the summary feels incomplete or inaccurate.
Translate summary in another language
Ask questions to this video
Chat for follow-up questions, clarifications, and source-backed answers.