atmega328p-pushbutton-led-control

Introduction

This experiment demonstrates how to use the ATmega328P microcontroller to control a digital output device (like an LED) based on the state of a push button.

Materials Required

No Ads Available.

Circuit Diagram

The following diagram shows how to connect the push button and LED to the ATmega328P:

Steps for the Experiment

  1. Connect the push button to an input pin on the ATmega328P and the LED to a digital output pin.
  2. Upload the program to read the button’s state and control the LED accordingly.
  3. Press the push button and observe the LED turning on and off.

Explanation

The ATmega328P reads the state of the push button. If the button is pressed, the microcontroller turns the LED on; otherwise, it turns it off.

Results and Observations

Contact Us

If you have any questions or inquiries, feel free to reach out to us at Microautomation.no@icloud.com .

Follow our Socials for the newest updates!