Discussion in "8051 Discussion Forum" started by    software_developer    Nov 3, 2014.
Mon Nov 03 2014, 12:17 pm
#1
i have to display no. from 0.000 to 3.000 on 16*2 lcd.
after pressing key no. should be increase by one.can anyone tell me how to do this.i have tried reading lcd but not works properly?
Wed Nov 05 2014, 12:31 am
#2
It's a kind of very simple. Don't think it as decimal number think it as an integer from 0 to 3000. Use sprints to conver your integer into a string format that looks like decimal. E.g.

sprintf(buffer, "%d.%03d", num/10, num%10);
Lcd_print(buffer);


Where num is an integer number that goes from 0 to 3000. You can simply do num++ to do the counting.
 software_developer like this.
Wed Nov 05 2014, 09:01 am
#3
sir, can u give me small example of code.i have tried this but no output on lcd.
can u explain me with code.
Wed Nov 05 2014, 09:58 am
#4
I already posted the code.
Wed Nov 05 2014, 11:10 am
#5
Hello sir,
i have attached code.tell me anything wrong in it.it is not working.please tell me the issue.
Wed Nov 05 2014, 11:56 pm
#6
You need to zip your files before attaching
Thu Nov 06 2014, 07:38 am
#7
PLease help me i have tried lot-
Controller-8051
frequency-11.0592 MHz
i have to us two keys of keypad-
by one key pressed-no. on lcd from location 0xC0 to 0xC4 will increase from 0.000 to 3.000.
by another key pressed of kepad the value should decrese from whatever the value on display.

i feel it difficult.can u help me please. i have tried lot.
application-time pulse generation.
whatever value display shows i have to calculate pulse of that sec.i.e.
if display shows 0.003 i have to generate pulse of 3msec.

please h
Fri Nov 07 2014, 02:32 am
#8
Your code generated several warnings.
most did not really matter, but some were telling
you there was a problem with "buffer".
You had defined it as
unsigned char buffer[]; ,which does not work.

unsigned char buffer[20]; does work.

Don't ignore warnings !
Attached is a working program, with surplus code removed
to clear the warnings.



Attachment


[ Edited Fri Nov 07 2014, 02:38 am ]
Fri Nov 07 2014, 12:00 pm
#9
sir,how to convert decimal to hex value
like 5630 decimal to 0xdc00 hex
Sun Nov 09 2014, 02:33 am
#10


sir,how to convert decimal to hex value
like 5630 decimal to 0xdc00 hex

software_developer


Is that part of this project ?

Hint..
5630 decimal is stored in two registers as 0x15 and 0xfe


[ Edited Sun Nov 09 2014, 02:45 am ]

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am