CLASE 1 - ENCENDIDO Y APAGADO DE UN LED CON UN PULSADOR / BOTON - TINKERCAD | ARDUINO

CLASE 1 - ENCENDIDO Y APAGADO DE UN LED CON UN PULSADOR / BOTON - TINKERCAD | ARDUINO

How to Turn On and Off an LED with a Button

Introduction to the Lesson

  • The video begins with an introduction, stating that this lesson will cover how to turn on and off an LED using a button.
  • The instructor mentions that they will use a 4-terminal push button instead of the previously used 2-terminal version.

Components Required

  • Key components include:
  • A 330-ohm resistor for the LED.
  • A push button.
  • An Arduino board connected via a breadboard (protoboard).

Wiring Setup

  • The wiring involves connecting:
  • The negative side of the LED through a resistor to ground.
  • Terminal connections of the push button: focusing on terminals A1 and A2.
  • The positive side of the LED connects to digital pin 2, while one terminal of the push button connects to digital pin 3.

Coding Overview

  • Transitioning from block coding to text coding, the instructor emphasizes removing unnecessary parts from previous code snippets.
  • They introduce variable declaration for input/output pins, specifically setting up pin modes for reading signals.

Logic Implementation

  • An if statement is introduced in programming logic:
  • It checks if the signal from pin 3 is HIGH (button pressed).
  • If true, it executes code to turn on the LED; otherwise, it turns off.

Simulation and Testing

  • After completing coding without errors, simulation starts.
  • Observations during simulation show that when not pressed, the LED remains off; pressing it turns on the LED.
Video description

LINK DEL TINKERCAD: https://www.tinkercad.com/things/cqRh62gY0bB ---------------------------------------------------------------------------------------------------- APRENDE ARDUINO DESDE 0 APRENDE TINKERCAD DESDE 0 COMO ENCENDER UN LED CON UN PULSADOR EN TINKERCAD COMO ENCENDER UN LED CON UN BOTON EN TINKERCAD COMO ENCENDER UN LED CON UN PULSADOR EN ARDUINO COMO ENCENDER UN LED CON UN BOTON EN ARDUINO COMO APAGAR UN LED CON UN EN TINKERAD COMO APAGAR UN LED EN ARDUINO ----------------------------------------------------------------------------------------------------- LEARN ARDUINO FROM 0 LEARN TINKERCAD FROM 0 HOW TO LIGHT AN LED WITH A PUSH BUTTON IN TINKERCAD HOW TO LIGHT AN LED WITH A BUTTON IN TINKERCAD HOW TO LIGHT AN LED WITH A PUSH BUTTON IN ARDUINO HOW TO LIGHT AN LED WITH AN ARUID BUTTON IN ARDUINO HOW TO TURN OFF AN LED WITH A IN TINKERAD HOW TO TURN OFF AN LED IN ARDUINO