SlideShare a Scribd company logo
1 of 3
EMBEDDED SYSTEMS TUTORIAL 9- INTERFACING 16X2
LCD WITH AVR PART-2
Hi…. friends this time I am here with another article ,we are going to discuss some interesting functions
and projects of LCD. In this tutorial we will learn about rotating a text , displaying integer and integers
operations, displaying floating point numbers and their operations .
ROTATING A TEXT STRING
Rotating a text on LCD is a bit tricky thing, to do so we will change the position of text every time with
some delay after clearing the screen so it will look like text is moving the sample code is given below just
use this source code in your LCD project and text will look like moving/*
* MOVINGTEXT.c
*
* Created: 1/12/2013 8:36:31 PM
* Author: ABHILASH DIXIT
*/

#include
#include
#include
#include
#include
#include

<stdlib.h>
<avr/io.h>
<avr/pgmspace.h>
<util/delay.h>
"lcd.h"
"lcd.c"

int main(void)
{
while(1)
{
lcd_init(LCD_DISP_ON);
for(int i=-10;i<16;i++)
// setting an integer i to 0 and incrementing
its value till 16
{
lcd_gotoxy(i,0);
// setting cursor to (i,0)
lcd_puts("LCD"); // to display text
if(i==13)
i=0;
_delay_ms(100);
// some delay
lcd_clrscr();
// clear display
}
}
}

So this was the trick to rotate the text string on the LCD.
USING INTEGERS ON LCD
You cannot use a integer on LCD directly for this you have to use a function itoa(), it converts an integer
in string form. So if we want to use integers in LCD we will first create a buffer of some size as
char buf[8];
now lets suppose the number to be displayed is i , so we will use itoa() function for i to convert it in string
form as
itoa(i,buf,10);
here 10 is for decimal, for hexadecimal we will use 16 and for binary we will use 2.
Now finally i can be displayed using lcd_puts() command aslcd_puts(buf);

so lets try a source code – in this program we will display a number i=0 and will increase its value till 10.
/*
* DISPLAY INTEGER.c
*
* Created: 1/12/2013 9:16:31 PM
* Author: ABHILASH DIXIT
*/
#include <stdlib.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
#include "lcd.h"
#include "lcd.c"
#include <util/delay.h>
int main()
{
while(1)
{
lcd_init(LCD_DISP_ON);
int i=0;
char buf[8];
lcd_gotoxy(0,0);
lcd_puts("i=");
for(i=0;i<=9;i++)
{
itoa(i,buf,10);
lcd_gotoxy(2,0);
lcd_puts(buf);
_delay_ms(100);
}
}
}

USING A FLOATING POINT NUMBER

// initializing display
// setting value of integer i to 0
// initializing buffer
// setting cursor position to (0,0)
// displaying text
// increasing value of i till 9
// using itoa() function
// setting cursor position to (2,0)
// displaying value of i every time
// some delay
Like an integer a floating point number cannot be used directly too , so to use an floating point no on LCD
we have to use some function called dtostrf() it converts an floating point number into string . let us
suppose we have to display a floating point number say i on LCD. So first of all we have to create a
buffer of some size
char buf[8];
then we will use dtostrf () function with i to convert i in string form as
dtostrf(i,10,6,buf);
here 10 is for decimal and 6 is denoting numbers after decimal we can change it accordingly.
Now the no i can be displayed using lcd_puts() command
Here is the source code for simply displaying a floating point number i=1.12345

/*
* DISPLAY FLOAT.c
*
* Created: 1/12/2013 9:26:31 PM
* Author: ABHILASH DIXIT
*/
#include <stdlib.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
#include "lcd.h"
#include "lcd.c"
int main()
{
lcd_init(LCD_DISP_ON);
float i=1.12345;
char buf[8];
dtostrf(i,10,6,buf);
lcd_puts(buf);
}

NOTE:- to use itoa() and dtostrf() we must include stdlib.h header file in beginning of the program .

I hope it was a useful article for you all……in case of any query, doubt or critical view just leave a
comment……..in next tutorial we well discuss about some other embedded systems topics till then
………..bye..

More Related Content

What's hot

讓 Python Script 擁有圖形化介面的簡單方法
讓 Python Script 擁有圖形化介面的簡單方法讓 Python Script 擁有圖形化介面的簡單方法
讓 Python Script 擁有圖形化介面的簡單方法
pycontw
 
completion_proc and history
completion_proc and historycompletion_proc and history
completion_proc and history
Nobuhiro IMAI
 

What's hot (20)

Open gl polygon code review
Open gl polygon code reviewOpen gl polygon code review
Open gl polygon code review
 
讓 Python Script 擁有圖形化介面的簡單方法
讓 Python Script 擁有圖形化介面的簡單方法讓 Python Script 擁有圖形化介面的簡單方法
讓 Python Script 擁有圖形化介面的簡單方法
 
Bubble sort
Bubble sortBubble sort
Bubble sort
 
Android Developer Days: Increasing performance of big arrays processing on An...
Android Developer Days: Increasing performance of big arrays processing on An...Android Developer Days: Increasing performance of big arrays processing on An...
Android Developer Days: Increasing performance of big arrays processing on An...
 
JavaScript - Agora nervoso
JavaScript - Agora nervosoJavaScript - Agora nervoso
JavaScript - Agora nervoso
 
completion_proc and history
completion_proc and historycompletion_proc and history
completion_proc and history
 
ClojureScript - A functional Lisp for the browser
ClojureScript - A functional Lisp for the browserClojureScript - A functional Lisp for the browser
ClojureScript - A functional Lisp for the browser
 
Probability of finding a single qubit in a state
Probability of finding a single qubit in a stateProbability of finding a single qubit in a state
Probability of finding a single qubit in a state
 
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
 
Codejunk Ignitesd
Codejunk IgnitesdCodejunk Ignitesd
Codejunk Ignitesd
 
Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"
Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"
Timur Shemsedinov "Пишу на колбеках, а что... (Асинхронное программирование)"
 
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
 
Wcbpijwbpij new
Wcbpijwbpij newWcbpijwbpij new
Wcbpijwbpij new
 
ADS-B Out Experiment
ADS-B Out ExperimentADS-B Out Experiment
ADS-B Out Experiment
 
Open GL Programming Training Session I
Open GL Programming Training Session IOpen GL Programming Training Session I
Open GL Programming Training Session I
 
LLVM Workshop Osaka Umeda, Japan
LLVM Workshop Osaka Umeda, JapanLLVM Workshop Osaka Umeda, Japan
LLVM Workshop Osaka Umeda, Japan
 
Bitcoin:Next
Bitcoin:NextBitcoin:Next
Bitcoin:Next
 
Mauro yaguachi
Mauro yaguachiMauro yaguachi
Mauro yaguachi
 
Ayam potong
Ayam potongAyam potong
Ayam potong
 
谈谈Javascript设计
谈谈Javascript设计谈谈Javascript设计
谈谈Javascript设计
 

Similar to Est 8 2 nd

C++totural file
C++totural fileC++totural file
C++totural file
halaisumit
 
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
eugeniadean34240
 
For this phase of the course project, you will research a bank to .docx
For this phase of the course project, you will research a bank to .docxFor this phase of the course project, you will research a bank to .docx
For this phase of the course project, you will research a bank to .docx
hanneloremccaffery
 

Similar to Est 8 2 nd (20)

_LCD display-mbed.pdf
_LCD display-mbed.pdf_LCD display-mbed.pdf
_LCD display-mbed.pdf
 
Est 8 1 st
Est 8 1 stEst 8 1 st
Est 8 1 st
 
LCD_Example.pptx
LCD_Example.pptxLCD_Example.pptx
LCD_Example.pptx
 
Lab Activity 3
Lab Activity 3Lab Activity 3
Lab Activity 3
 
C++ tutorial
C++ tutorialC++ tutorial
C++ tutorial
 
REPORT MINI PROJECT.docx
REPORT MINI PROJECT.docxREPORT MINI PROJECT.docx
REPORT MINI PROJECT.docx
 
C++totural file
C++totural fileC++totural file
C++totural file
 
Build 2016 - B880 - Top 6 Reasons to Move Your C++ Code to Visual Studio 2015
Build 2016 - B880 - Top 6 Reasons to Move Your C++ Code to Visual Studio 2015Build 2016 - B880 - Top 6 Reasons to Move Your C++ Code to Visual Studio 2015
Build 2016 - B880 - Top 6 Reasons to Move Your C++ Code to Visual Studio 2015
 
Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game
 
Quiz 9
Quiz 9Quiz 9
Quiz 9
 
131080111003 mci
131080111003 mci131080111003 mci
131080111003 mci
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
Howto curses
Howto cursesHowto curses
Howto curses
 
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
 
Alp lcd
Alp lcdAlp lcd
Alp lcd
 
C++ Course - Lesson 1
C++ Course - Lesson 1C++ Course - Lesson 1
C++ Course - Lesson 1
 
For this phase of the course project, you will research a bank to .docx
For this phase of the course project, you will research a bank to .docxFor this phase of the course project, you will research a bank to .docx
For this phase of the course project, you will research a bank to .docx
 
Oops presentation
Oops presentationOops presentation
Oops presentation
 
C++
C++C++
C++
 
Toonz code leaves much to be desired
Toonz code leaves much to be desiredToonz code leaves much to be desired
Toonz code leaves much to be desired
 

More from Akshay Sharma

Eye monitored wheel chair control for people suffering from quadriplegia
Eye monitored wheel chair control for people suffering from quadriplegiaEye monitored wheel chair control for people suffering from quadriplegia
Eye monitored wheel chair control for people suffering from quadriplegia
Akshay Sharma
 
The next generation classroom smart, interactive and connected learning envir...
The next generation classroom smart, interactive and connected learning envir...The next generation classroom smart, interactive and connected learning envir...
The next generation classroom smart, interactive and connected learning envir...
Akshay Sharma
 
Over voltage protector circuit
Over voltage protector circuitOver voltage protector circuit
Over voltage protector circuit
Akshay Sharma
 
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Akshay Sharma
 
A_law_and_Microlaw_companding
A_law_and_Microlaw_compandingA_law_and_Microlaw_companding
A_law_and_Microlaw_companding
Akshay Sharma
 
Ldr based line follower robot
Ldr based line follower robotLdr based line follower robot
Ldr based line follower robot
Akshay Sharma
 
Arduino Full Tutorial
Arduino Full TutorialArduino Full Tutorial
Arduino Full Tutorial
Akshay Sharma
 

More from Akshay Sharma (13)

Eye monitored wheel chair control for people suffering from quadriplegia
Eye monitored wheel chair control for people suffering from quadriplegiaEye monitored wheel chair control for people suffering from quadriplegia
Eye monitored wheel chair control for people suffering from quadriplegia
 
The buzzer glove
The buzzer gloveThe buzzer glove
The buzzer glove
 
The next generation classroom smart, interactive and connected learning envir...
The next generation classroom smart, interactive and connected learning envir...The next generation classroom smart, interactive and connected learning envir...
The next generation classroom smart, interactive and connected learning envir...
 
Over voltage protector circuit
Over voltage protector circuitOver voltage protector circuit
Over voltage protector circuit
 
Haptic technology
Haptic technologyHaptic technology
Haptic technology
 
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
 
A_law_and_Microlaw_companding
A_law_and_Microlaw_compandingA_law_and_Microlaw_companding
A_law_and_Microlaw_companding
 
8085 instructions
8085 instructions8085 instructions
8085 instructions
 
Ldr based line follower robot
Ldr based line follower robotLdr based line follower robot
Ldr based line follower robot
 
Arduino Full Tutorial
Arduino Full TutorialArduino Full Tutorial
Arduino Full Tutorial
 
Est 11
Est 11Est 11
Est 11
 
Est 6
Est 6Est 6
Est 6
 
Est 1
Est 1Est 1
Est 1
 

Recently uploaded

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Recently uploaded (20)

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 

Est 8 2 nd

  • 1. EMBEDDED SYSTEMS TUTORIAL 9- INTERFACING 16X2 LCD WITH AVR PART-2 Hi…. friends this time I am here with another article ,we are going to discuss some interesting functions and projects of LCD. In this tutorial we will learn about rotating a text , displaying integer and integers operations, displaying floating point numbers and their operations . ROTATING A TEXT STRING Rotating a text on LCD is a bit tricky thing, to do so we will change the position of text every time with some delay after clearing the screen so it will look like text is moving the sample code is given below just use this source code in your LCD project and text will look like moving/* * MOVINGTEXT.c * * Created: 1/12/2013 8:36:31 PM * Author: ABHILASH DIXIT */ #include #include #include #include #include #include <stdlib.h> <avr/io.h> <avr/pgmspace.h> <util/delay.h> "lcd.h" "lcd.c" int main(void) { while(1) { lcd_init(LCD_DISP_ON); for(int i=-10;i<16;i++) // setting an integer i to 0 and incrementing its value till 16 { lcd_gotoxy(i,0); // setting cursor to (i,0) lcd_puts("LCD"); // to display text if(i==13) i=0; _delay_ms(100); // some delay lcd_clrscr(); // clear display } } } So this was the trick to rotate the text string on the LCD.
  • 2. USING INTEGERS ON LCD You cannot use a integer on LCD directly for this you have to use a function itoa(), it converts an integer in string form. So if we want to use integers in LCD we will first create a buffer of some size as char buf[8]; now lets suppose the number to be displayed is i , so we will use itoa() function for i to convert it in string form as itoa(i,buf,10); here 10 is for decimal, for hexadecimal we will use 16 and for binary we will use 2. Now finally i can be displayed using lcd_puts() command aslcd_puts(buf); so lets try a source code – in this program we will display a number i=0 and will increase its value till 10. /* * DISPLAY INTEGER.c * * Created: 1/12/2013 9:16:31 PM * Author: ABHILASH DIXIT */ #include <stdlib.h> #include <avr/io.h> #include <avr/pgmspace.h> #include "lcd.h" #include "lcd.c" #include <util/delay.h> int main() { while(1) { lcd_init(LCD_DISP_ON); int i=0; char buf[8]; lcd_gotoxy(0,0); lcd_puts("i="); for(i=0;i<=9;i++) { itoa(i,buf,10); lcd_gotoxy(2,0); lcd_puts(buf); _delay_ms(100); } } } USING A FLOATING POINT NUMBER // initializing display // setting value of integer i to 0 // initializing buffer // setting cursor position to (0,0) // displaying text // increasing value of i till 9 // using itoa() function // setting cursor position to (2,0) // displaying value of i every time // some delay
  • 3. Like an integer a floating point number cannot be used directly too , so to use an floating point no on LCD we have to use some function called dtostrf() it converts an floating point number into string . let us suppose we have to display a floating point number say i on LCD. So first of all we have to create a buffer of some size char buf[8]; then we will use dtostrf () function with i to convert i in string form as dtostrf(i,10,6,buf); here 10 is for decimal and 6 is denoting numbers after decimal we can change it accordingly. Now the no i can be displayed using lcd_puts() command Here is the source code for simply displaying a floating point number i=1.12345 /* * DISPLAY FLOAT.c * * Created: 1/12/2013 9:26:31 PM * Author: ABHILASH DIXIT */ #include <stdlib.h> #include <avr/io.h> #include <avr/pgmspace.h> #include "lcd.h" #include "lcd.c" int main() { lcd_init(LCD_DISP_ON); float i=1.12345; char buf[8]; dtostrf(i,10,6,buf); lcd_puts(buf); } NOTE:- to use itoa() and dtostrf() we must include stdlib.h header file in beginning of the program . I hope it was a useful article for you all……in case of any query, doubt or critical view just leave a comment……..in next tutorial we well discuss about some other embedded systems topics till then ………..bye..