B2: Alternate Control of LED & Buzzer

AR-B2: Alternate Control of LED & Buzzer

This entry is part 2 of 13 in the series Arduino Basic Circuits

This code is used to blink the LED connected at pin-13 of Arduino UNO and produce buzzer beeps alternately. First type the code by creating new file in Arduino IDEWhat is Arduino IDE? Arduino IDE stands for Integrated Development Environment. It is also called as Arduino software in general language or Arduino compiler. It is used to convert high level programming language like C/C++ program into machine code i.e. into low level language., save the file and then upload it.

Required Material

Arduino UNO Board – 1, data cable – 1, Red LED – 1, Resistor 1kΩ (Brown Black Red) – 1, Buzzer – 1, Jumper wires - 4.

Working

After uploading the code in Arduino UNO board, the buzzer and LED “L” will be ON alternately. This happens because of alternate action written in the code.

The Code

Upload the following code in Arduino UNO to control LED and buzzer in alternate action. It is very interesting code, which will help you understand the simple logic behind controlling number of devices using Arduino.

Signup or Login to view remaining content. It's Completely Free!
Share on your network!
Dattaraj Vidyasagar
Dattaraj Vidyasagar

Author on this website. He is veteran of Core Electronics since last 36+ years. ATL Mentor of Change, Niti Ayog, Govt. of India, Google Certified Educator, International Robotics Trainer and author of 18 books on electronics, robotics, programming languages and web designing... ➤➤

Leave a Reply

Your email address will not be published. Required fields are marked *