You are on page 1of 7

LAB#1: Arduino

FACULTY OF ENGINEERING AND IT


COMPUTER SYSTEMS ENGINEERING DEPARTMENT

Embedded Systems Lab Report


LAB#1: Arduino

Date:4.11.2023

Student Name: Zeineddin Shawahna


Student ID:202012651
Instructor Name: Eng. Yusra Abu Alrub
Supervisor Name: Dr. Mujahed Elayyat
Section: 1
Partner Name if any: ….

Date : 4.11.2023 1/7


LAB#1: Arduino

1. INTRODUCTION
In this experiment we will learn about the Arduino. The Arduino has 16
digital pins and 6 analog pins. It has AT mega integrated circuit. We will use
built in functions that make the code more simple. We will use application
Arduino IDE to write, compile, and upload the code to the Arduino board.
The code will control the behaviour of the connected components based on
the input received from various sensors or user interactions.

2. OBJECTIVES
1. To get to know the Arduino and its parts .
2. To know how can we use the Arduino.
3. To Connect external components, such as LEDs, push buttons to the Arduino board and learn how to
interface them using the digital pins.

3. COMPONENTS REQUIRED:
ID Component name Amount
1 Arduino 1
2 Resistances 1

3 Power supply 1
4 Wires
5 USB 1
6 LEDS 2
7 computer 1

www.tinkercad.com //We used the emulator


//These requirements are in the case of practical application when returning to the laboratory

Date : 4/11/2023 2/7


LAB#1: Arduino

4. TASKS

Task#1: Connect two LEDs to Arduino UNO. Alternate LEDs every 0.5 seconds (One LED
is ON the other is OFF).
// C++ CODE
//
INT LEDPIN =7;

INT LEDPIN 1=6;

//INT LEDPIN2=5;
VOID SETUP ()

{
PINM ODE(LEDPIN , OUTPUT);
PINM ODE(LEDPIN 1, OUTPUT);
//PINMODE(LEDPIN2, OUTPUT);
}

VOID LOOP ()

{
DIGITAL WRITE(LEDPIN , HIGH);
DELAY (500); // WAIT FOR 0.5(S)
DIGITAL WRITE(LEDPIN , LOW);
DELAY (500); // WAIT FOR 0.5(S)
DIGITAL WRITE(LEDPIN 1, HIGH);
DELAY (500); // WAIT FOR 0.5(S)
DIGITAL WRITE(LEDPIN 1, LOW);
DELAY (500);// WAIT FOR 0.5(S)

Date : 4/11/2023 3/7


LAB#1: Arduino

Task#2: Connect a button and a LED to Arduino UNO. The LED blink every 1 second.
Each time the button is pressed and released, the blinking time is reduced by 100ms.
// C++ CODE
//
INT INPUT =3;

INT OUTPUT =7;

INT TIME=1000;

VOID SETUP ()

{
PINM ODE(INPUT , INPUT);
PINM ODE(OUTPUT , OUTPUT);
}

VOID LOOP ()

{
INT S = DIGITALREAD(INPUT);

IF (S == HIGH)
{
TIME -= 100;
}

DIGITAL WRITE(OUTPUT , HIGH);


DELAY (TIME);

DIGITAL WRITE(OUTPUT , LOW);


DELAY (TIME);

Date : 4/11/2023 4/7


LAB#1: Arduino

5. FLOWCHARTS

Task1 Task2

Date : 4/11/2023 5/7


LAB#1: Arduino

6. BLOCK DIAGRAM

T
ASK1

TASK 2

Date : 4/11/2023 6/7


LAB#1: Arduino

7. PROCEDURES
1. I logged in to Tinkercad.
2. Created a new circuit.
3. I looked for the Arduino, LED, resistors and button.
4. I connected the electrical circuit and LEDs.
5. I wrote the special operating code for this experiment (what you want).
6. I ran the emulator
7. we ran the program and saw the results directly.

8. DISCUSSIONS AND CONCLUSIONS


Arduino is an open source computer hardware and software company and user community that designs and manufactures
single-board micro-controllers and controllers kits also called Development board for building digital devices.
We used the resistance with the LEDs because LEDS require a specific amount of current to operate correctly. If a higher
current flows through an LED than it can handle, it may get damaged. The resistor helps limit the current flowing through
the LED by creating a voltage drop across it. This ensures that the LED operates within its specified current range and
prevents excessive current from damaging it.

Date : 4/11/2023 7/7

You might also like