Sunteți pe pagina 1din 5

Page#1

Microprocessor lab#13

LAB #13
Objective:
To study and understand how to use
 Arduino board by both implementing and
 programming.

Theory:
Arduino:
Arduino is an open-source electronics platform based on easy-to-use hardware and
software. Arduino boards are able to read inputs - light on a sensor, a finger on a
button, or a Twitter message - and turn it into an output - activating a motor, turning
on an LED, publishing something online.
In fact, you already are; the Arduino language is merely a set of C/C++ functions
that can be called from your code. Your sketch undergoes minor changes (e.g.
automatic generation of function prototypes) and then is passed directly to a C/C++
compiler (avr-g++).

The Uno is one of the more popular boards in the


Arduino family and a great choice for beginners.
We’ll talk about what’s on it and what it can do later
in the tutorial. The Arduino Uno is a microcontroller
board based on the ATmega328. It has 20 digital
input/output pins (of which 6 can be used as PWM
outputs and 6 can beused as analog inputs), a 16 MHz resonator, a USB
connection, a power jack, an in-circuit system programming (ICSP) header, and a
reset button.

Muhammad Abdullah Zubair 2k16-ele-142 Microprocessor lab manual#13


Page#2
Microprocessor lab#13

This is a screenshot of the Arduino IDE.

Those 10 lines of code are all you need to blink the on-board LED on your
Arduino.
How to download/install Arduino:
 Open google browser
 Type extratorrent.cc
 Now open the site of www.extratorrent .cc
 Now go to search box and type Arduino IDE
 Now click on search
 Now download the ide file from given link
 Drivers will be automatically install from this site
 Then open it and install
Steps to upload the program:
 First of all, open the ide software
 Now write the required program on given space
 After the program is complete verify the program to debug errors
 After that connect the Arduino board

Muhammad Abdullah Zubair 2k16-ele-142 Microprocessor lab manual#13


Page#3
Microprocessor lab#13

 Go to tool then go to board option and choose the desired board you are
using
 Now again go to tool and go to port and select port that your board is
connected to
 Now click on the upload button
 And it’s ready to connect to the circuit
Example # 01
Potentiometer serial monitor and plotter
Components:

 Arduino Uno
 10K Potentiometer
 Wires

How to connect:

 Attach the center pin of a potentiometer to


Analog 0 (A0)
 And the outside pins to +5V and ground
(GND)

Program:
void setup () {

Serial.begin(9600);

void loop () {

int sensor Value = analog Read(A0);

Muhammad Abdullah Zubair 2k16-ele-142 Microprocessor lab manual#13


Page#4
Microprocessor lab#13

Serial.println(sensor Value);

delay (1000);

Muhammad Abdullah Zubair 2k16-ele-142 Microprocessor lab manual#13


Page#5
Microprocessor lab#13

Conclusion:
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------

Muhammad Abdullah Zubair 2k16-ele-142 Microprocessor lab manual#13

S-ar putea să vă placă și