Professional Documents
Culture Documents
409k
Follow @EngineersGarage
Follow
Home
Insight
Contribute
EG Labs
Advertise
Articles
Subscribe
Invention Stories
Forum
Knowledge Base
Contact Us
Change Password
Log out
FEATURED
ARDUINO
PROJECTS
Getting Started
with Arduino
LCD Arduino
Interfacing
Xbee Arduino
Interfacing
Interface GPS with
Arduino
Interface SD Card
with Arduino
Call using Keyboard,
GSM & Arduino
SPI Module of
Arduino
... more arduino
projects
TI REFERENCE
DESIGN LIBRARY
Featured
Design
ELECTRONIC
POINT OF
SALE/SERVICE
REFERENCE
DESIGN
ARD008
Summary
Description
Circuit Diagram
Video
Code
Components
Available Files:
Schematic
Diagram, Source
Codes, Design
Guide, etc.
ViewDesign
Search More
Designs
Industrial
Smart Grid
Lighting
Since the Arduino pro-mini board has no circuitary for interfacing it with the serial
port or the USB port of the PC, an external USB to TTL converter board is required to
connect it with the PC. This hardware helps in programming the Arduino board and also
helps in the serial communication with the USB port of the PC.
Alternative Energy
Automation &
Process Control
Automotive &
Transportation
Comm & Telecom
Computing &
Multimedia
Consumer
Electronics
HealthTech
Motor Drive &
Control
Safety & Security
It is assumed that the reader has gone through the project how to get started with the
Arduino and tried out all the things discussed there.
A previous project on how to use analog input and output of the Arduino discusses
about how to use analog input /output channels of the Arduino board to read analog
values and to write analog values. Another project explains how it is possible to debug
ACTIVE FORUM
TOPICS
Query about
ATmega16
the values which are received by the Arduino board and which the Arduino board write to
the external pin so as to generate a voltage.The variable pin of a potentiometer is
connected to the analog pin;in this project the pin A0. The other two pins of the
potentiometer is connected to the VCC and GND so that as the variable moves it can
How to setup
communication
between two
zigbee(cc2500)
devices using
PIC16F877A.
topics on 8051
Coding RF IC
divide the entire supply voltage and provide it as the analog input voltage for the Arduino
board. An LED is connected to the analog output pin through a current limiting resistor;
in this project it is connected to the pin 6. The code continuously reads the value from
the potentiometer and writes the corresponding value to change the brightness of the
LED connected to the pin 6.
The code written for this project make use of the analog read and write functions like
analogRead() andanalogWrite() etc. It also uses library functions which help to access
more
the LCD module like lcd.begin(), and lcd.print() . These functions for accessing the LCD
are available in the header file <LiquidCrystal.h>. The details of the analog read and
write functions are explained in a previous project on how to use analog input and
output of the Arduino. The functions for interfacing the LCD are discussed in the
FEATURED
RASPBERRY PI
PROJECTS
previous project on how to interface 16*2 LCD with the Arduino board.
In this particular project one more function from the <LiquidCrystal.h> is used which is
not there in the previous project and is discussed below.
How to Load
Ubuntu on
Raspberry Pi
How to Configure
Raspberry Pi
lcd.setCursor()
The lcd.setCursor() function is used to set the position of the cursor in the LCD screen
in such a way that the subsequent letters will be displayed from that particular position
only. The function has two parameters and the first one represents the column number
and the second one represents the row number. The row and column number starts
with zero and the maximum value depend on the type of LCD used.
The lcd.setCursor() can be used to set the cursor at a particular position of the LCD
screen as shown in the following statement;
lcd.setCursor(7,0);
The above statement will set the cursor at the 8th position of the first line of an LCD
screen and further display will happen from that position onwards.
RELATED
CONTENT
THE CODE
The code initializes the 16*2 LCD using the function lcd.begin() after initializing the
Getting Started
with Arduino
library using the function LiquidCrystallcd(). The analog value is read from the analog
mode using the function map(). The value is thgen multiplied by 5 and is divided by 255
input pin using the function analogRead() and is then mapped from 10 bit mode to 8 bit
to get the 5V equivalent of that value. The lcd.print() function is then used to print the
value after setting the cursor using lcd.setCursor() function.
// include the library code:
#include <LiquidCrystal.h>
Arduino Board
How to Receive
and Send Serial
Data using Arduino
Pressure
Sensors
alibaba.com/Press
void setup()
{
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.print("ENGINEERS GARAGE");
}
void loop()
{
// read the analog in value:
potvalue = analogRead(analogInPin);
// map it to the range of the analog out:
outputvalue = map(potvalue, 0, 1023, 0, 255);
lcd.setCursor(7, 2);
lcd.print((outputvalue * 5)/255);
lcd.print("V");
// change the analog out value:
analogWrite(analogOutPin, outputvalue);
delay(100) ;
}
The code also glows an LED with the brightness which is equivalent to the value read
from the analog input pin as discusses in a previous project on how to use analog input
and output of the Arduino.
Once done with the coding one can verify and upload the code to the Arduino board as
explained in the project how to get started with the Arduino and the brightness of the
LED can be observed to vary as the variable of the potentiometer moves. The voltage
read from the analog input pin will be displayed in the LCD along with varying the
brightness of the LED.
Like
3937 reads
Tw eet
Top