0% found this document useful (0 votes)
68 views4 pages

Activity 0 Blinking Led: Logic Circuit and Switching Laboratory Manual Msu-Iit

This document provides instructions for an activity using an Arduino Uno board to blink an LED. The objectives are to familiarize students with the Arduino IDE and basic board operation. Students will connect an LED to pin 13 via a resistor, load a blink example code into the IDE, verify and upload it to the board to toggle the LED on and off with 1 second delays. The code uses the setup, loop, pinMode, digitalWrite and delay functions to configure the pin as output and write high/low voltages to turn the LED on and off.

Uploaded by

Mark Eric
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views4 pages

Activity 0 Blinking Led: Logic Circuit and Switching Laboratory Manual Msu-Iit

This document provides instructions for an activity using an Arduino Uno board to blink an LED. The objectives are to familiarize students with the Arduino IDE and basic board operation. Students will connect an LED to pin 13 via a resistor, load a blink example code into the IDE, verify and upload it to the board to toggle the LED on and off with 1 second delays. The code uses the setup, loop, pinMode, digitalWrite and delay functions to configure the pin as output and write high/low voltages to turn the LED on and off.

Uploaded by

Mark Eric
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

LOGIC CIRCUIT AND SWITCHING laboratory MANUAL

MSU-IIT

ACTIVITY 0

BLINKING LED

OBJECTIVE

This example aims to familiarize the student with the basic operation of the Arduino Uno board, and
Integrated Development Environment (IDE). By the end of the exercise, the student should be able to
know the basic functionalities of the IDE.

MATERIALS

Arduino Uno AtMega328 Board


Breadboard
Jumper wires
LED
220-ohm resistor

DIRECTIONS

1. Proceed to the Arduino Folder and double-click the Arduino application to open the Arduino IDE which
is also shown below:

ACTIVITY No. 0 ARDUINO BASICS Page 1 of 4


LOGIC CIRCUIT AND SWITCHING laboratory MANUAL
MSU-IIT
2. Type the following lines of code on the front panel. The code can also be found in the examples folder
of Arduino. To copy it, just navigate from arduino-00XX > examples > Basics > Blink.

3. Press Ctrl + S or icon on the IDE to save your sketch (the term for a source code in Arduino).
4. Click the Verify Button (A on the fig.) to check if the sketch has no errors. At the bottom of the screen
you should see if the sketch was successfully scanned free of problems (B on the fig.). Moreover, the size
of the sketch file (C on the fig.) is also indicated on the black screen at the bottom to shows that it fits
the flash memory of the Arduino Uno.

5. Connect an LED to a 470Ω resistor. Note: that the longer leg of the LED is the positive (connected to one
end of resistor and the shorter one is the negative (connected to the ground). The other end of the
resistor should then be connected to the specified pin which is 13.

ACTIVITY No. 0 ARDUINO BASICS Page 2 of 4


LOGIC CIRCUIT AND SWITCHING laboratory MANUAL
MSU-IIT
6. Check if the board selected in the IDE is the one you are using, the Arduino Uno board.

7. Next, make sure that the Arduino board’s COM port is properly identified by the IDE. To do this, connect
the board to the computer then from the IDE front panel go to Tools > Serial Port. A list of COM’s should
be there, choose the COM number associated with the microcontroller board. Note: the microcontroller
board’s COM no. is found near the name of the device’s driver in Device Manager.

8. Finally, upload the sketch made earlier into the board by clicking the icon in the IDE. The status of
the upload can be found near the bottom of the program [2].

ACTIVITY No. 0 ARDUINO BASICS Page 3 of 4


LOGIC CIRCUIT AND SWITCHING laboratory MANUAL
MSU-IIT

CODE EXPLANATION

Line Code
1 Creates a function called setup. The function type is void and therefore does not return any
value after execution. This is only read once in a file execution and is required in a sketch.
2 The function pinMode() configures the specified pin which is 13 in this sample. It sets digital pin
13 as output.
3 Creates a function called loop. The function type is also void and therefore also does not return
any value after execution. This is read repeatedly in a file execution and usually where the main
program is. This is also required in a sketch.
4 The digitalWrite() function writes a high(5V) or low(0V) on a specified pin. In this case, a high
state is written on pin 13 to light the LED.
5 The delay function needs a constant or variable of how long in millisecond the delay will be.
This line prolongs for 1000 millisecond the LED at ON state.
6 Similar to line 4, pin 13 was set this time to low to turn off the LED.
7 This line is the same as line 5 and prolongs the LED at OFF state for 1 second.

ACTIVITY No. 0 ARDUINO BASICS Page 4 of 4

You might also like