0% found this document useful (0 votes)
15 views30 pages

1.2 Arduino Introduction

This document provides an overview of an Arduino, IoT FAB Lab course. It describes the course code, name, and department. It then discusses the Arduino board components, the Arduino IDE interface, basic coding structure including setup and loop functions, and coding syntax for functions like pinMode, digitalWrite, digitalRead, and delay.

Uploaded by

Sayan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
0% found this document useful (0 votes)
15 views30 pages

1.2 Arduino Introduction

This document provides an overview of an Arduino, IoT FAB Lab course. It describes the course code, name, and department. It then discusses the Arduino board components, the Arduino IDE interface, basic coding structure including setup and loop functions, and coding syntax for functions like pinMode, digitalWrite, digitalRead, and delay.

Uploaded by

Sayan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 30

Course Code: MC1030

Course Name: Arduino, IoT FAB Lab.

ARDUINO and Arduino IDE Interface

Department of Mechatronics | SAMM


Faculty of Engineering | Manipal University Jaipur
Contents

• Introduction

• Components

• IDE Tool

• IDE Interface

• Coding Structure

• Coding Syntax
Introduction

Learn by Doing – Sense, Control & Actuate

• Embedded Systems
• Arduino Basics
• Arduino Architecture
• Arduino board layout. What are the resources available
• Arduino IDE
• Programming fundamentals

3
Components

Arduino Uno
1. Power In (Barrel Jack): Can be used with either a 9V or 12V wall-wart or battery

2. Power In (USB Port): Provides power and communicates with your board when plugged
into your computer via USB.

3. LED (RX: Receiving): Lights up when the Arduino is receiving data (such as when being
programmed).

4. LED (TX: Transmitting): Lights up when your Arduino is transmitting data (such as
when running a program).
Components

5. LED (Pin 13: Troubleshooting): LED is incorporated into your sketch to show if your
program is running properly.

6. Pins (ARef, Ground, Digital, Rx, Tx): Used for inputs, outputs, power, and ground.

7. LED (Indicates Arduino is ON): Simple power indicator LED.

8. Reset button: Used to manually reset Arduino, which makes code restart.

9. ICSP Pins: For “in-circuit serial programming,” used if you want to bypass the
bootloader.

10. Pins (Analog In, Power In, Ground, Power Out, Reset): Used for inputs, outputs,
power, and ground.
Components

Arduino Basics
arduino ( arrr-dween-oh )

(n.) It's an open-source physical computing platform based


on a simple microcontroller board, and a development
environment for writing software for the board.
Components
Types of Arduino Boards

Arduino Nano

Arduino Mega
Arduino LilyPad

Arduino Uno
Arduino Mini
Arduino Leonardo
Components

Arduino Uno

Digital pins:
• 14 digital IO pins
• 6 are PWM pins (3, 5, 6, 9, 10, and 11).

Analog pins:
• 6 analog pins(A0, A1, A2, A3, A4, and
A5)
• Takes analog values as an input
Components
IDE Tool

Arduino IDE
VERIFY SERIAL
MONITOR
UPLOAD
NEW TAB
OPEN CODE GOES
SAVE HERE
BOARD &
SERIAL PORT
SELECTIONS
Interfaces – IDE Tool

Download Arduino IDE


(Integrated Development Environment)

arduino.cc/en/main/software
Interfaces – IDE Tool

Connect RedBoard to your Computer


Interfaces – IDE Tool

Install Arduino Drivers


Interfaces – IDE Tool

OPEN Arduino IDE


Interfaces – IDE Tool

Select your Board


Interfaces – IDE Tool

Select Serial Port (Windows)


Interfaces – IDE Tool

Select Serial Device (Mac)


Interfaces – IDE Tool

KNOW the Arduino GUI


Verify:
Compiles and
approves your
code. Will catch
errors in syntax.
Interfaces – IDE Tool

KNOW the Arduino GUI


Upload: Sends
your code to the
Arduino Board.
When you clicked
it, you should see
lights on your
board blink rapidly.
Interfaces – IDE Tool

KNOW the Arduino GUI

New:
Open-up a
new code
window tab.
IDE Interfaces

KNOW the Arduino GUI


Open: Open an
existing sketch,
which is where you
write your code.
IDE Interfaces

KNOW the Arduino GUI

Save: Saves
the currently
open sketch.
IDE Interfaces

KNOW the Arduino GUI

Serial Monitor:
Opens a window that
displays any serial
info the Board is
transmitting. Very
useful for debugging.

What is Serial?
Process of sending
data one bit (0 or
1) at a time.
IDE Interfaces

KNOW the Arduino GUI

Sketch
Name: Name of
the sketch you are
currently working
on.
IDE Interfaces

KNOW the Arduino GUI

Code Area:
Area where you
compose the code
for your sketch.
IDE Interfaces

KNOW the Arduino GUI

Message
Area: Where
the IDE tells you
if there were any
errors in your
code.
Coding Structure

Basic Coding structure

4
Coding Structure

Basic Coding structure


▪ setup() function
• Called when a sketch starts.
• To initialize variables, pin modes, start using libraries, etc.
• Will only run once, after each power-up or reset of the
Arduino board.
▪ loop() function
• Loops consecutively.
• Code in the loop() section of the sketch is used to actively
control the Arduino board.
▪ Commenting
• Any line that starts with two slashes (//) will not be read by
the compiler, so you can write anything you want after it.
Coding Syntax

▪ pinMode() ▪ digitalRead()
• Instruction used to set the mode (INPUT or • Reads the value from a specified digital pin,
OUTPUT) in which we are going to use a either HIGH or LOW
pin.
• Eg: int inPin=7;
• Eg: pinMode (13, OUTPUT);
val = digitalRead(inPin);
• ie. setting pin13 as output. • ie. reads the value from inPin and assigns it to
val.
▪ digitalWrite() ▪ delay()
• Write a HIGH or a LOW value to a digital • Pauses the program for the amount of time (in
pin. milliseconds) specified as a parameter.
• Eg: digitalWrite (11, HIGH); • Eg: delay(1000);
• ie. setting pin 11 to high. • ie. waits for a second (1000 ms = 1 s)

29
V

Thank You!

You might also like