You are on page 1of 8

University Institute of Engineering

Department of Computer Science & Engineering

Experiment: 1.1

STUDENT’S NAME – Yash Parmar

STUDENT’S UID – 21BCS7524

CLASS AND GROUP –416A

SEMESTER –02

1. AIM OF THE PRACTICAL: Introduction to open-source IoT Platform and


basic interfacing Hands-on.

2. TOOL USED: Arduino Software, ESP32, LED, Resistor, Breadboard, Arduino.

3. BASIC CONCEPT/ COMMAND DESCRIPTION:

Step 1: #define LED 2

As a best practice, we use some defines to keep the pin number for the LED- The
Pin the LED is connected to. Also, in the future if we want to change the LED from
pin 2 to another pin, we can modify this line without touching anything else in the
code.
University Institute of Engineering
Department of Computer Science & Engineering

Step 2: void setup()

Every Arduino sketch includes void setup() and void loop(). Without them, your
program won’t run!

 The code that you put inside void setup() will only run once, and that will be
at the beginning of your program. One example is when you want to turn
your robot on — that does not happen multiple times!

As the void setup function is called only once at the very beginning of the program,
this will be the place to:

·        Initialize variables’ values.

·        Setup communications (ex: Serial).

·        Setup modes for digital pins (input/output).

·        Initialize any hardware component (sensor/actuator) plugged to the Arduino.

·        Etc.

The void setup, as its name suggest, is made for you to do any setup required at
the beginning of the program.

Step 3:  pinMode(LED, OUTPUT);

Syntax

pinMode(pin, mode)

The pinMode() function is used to configure a specific pin to behave either as an


input or an output.
University Institute of Engineering
Department of Computer Science & Engineering

Step 4: void loop()

 In void loop(), your code will repeat over and over again.
 The loop() function will run over-and-over-and-over until the Arduino is reset.

Step 5:  

 digitalWrite(LED, HIGH);   // turn the LED on (HIGH is the voltage level)
  Serial.println("HIGH");
  delay(500);                       // wait for half a second
  digitalWrite(LED, LOW);    // turn the LED off by making the voltage LOW
  Serial.println("LOW");
  delay(500);
 
Syntax
digitalWrite(pin, value)

4. CIRCUIT DIAGRAM:
University Institute of Engineering
Department of Computer Science & Engineering

5. CODE:
University Institute of Engineering
Department of Computer Science & Engineering

6. OBSERVATIONS, SIMULATION SCREEN SHOTS AND DISCUSSIONS:


University Institute of Engineering
Department of Computer Science & Engineering

When the LED is “TURN ON”

When the LED is “TURN OFF” i.e. delay time


University Institute of Engineering
Department of Computer Science & Engineering
University Institute of Engineering
Department of Computer Science & Engineering

7. RESULT AND SUMMARY:

Open Source IOT platform is been introduced.

8.LEARNING OUTCOMES (WHAT I HAVE LEARNT):

1. We have learnt the application and physical usage of Arduino.

2. We have learnt how a bunch of codes can control the hardware.

3. We have learnt the usage of Arduino IDE Software.

Evaluation Grid (To be filled by Faculty):


Sr. No. Parameters Marks Obtained Maximum Marks
1. Worksheet completion including 10
writinglearning objectives/Outcomes.
(To besubmitted at the end of the day)
2. Post Lab Quiz Result. 5
3. Student Engagement in 5
Simulation/Demonstration/
Performance and Controls/Pre-Lab
Questions.
Signature of Faculty (with Date): Total Marks Obtained: 20

You might also like