Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to print intger to a LCD in MkroC for AVR

Status
Not open for further replies.

sonuv12hack

Newbie level 3
Newbie level 3
Joined
Nov 25, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,297
Hi I m using ATmega16,MikroC pro for AVR,16*2 LCD(JHD162A)
when m using lcd out function in only prints the word inside " "
example

char txt1[]="hello"; ---> no error prints Hello

int txt2[]="x"; ---->error
x=5;

what to do ?
i want to print integer.
 

You're confusing two completely different types: the integer type and a string type. You need to convert the integer type x into a string representation before displaying on the display. Try this:

Code:
#include <stdio.h>
char str[32];
sprintf(str, "%d", x);
// now write 'str' to the LCD
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top