My learning thread - thanks everyone
Mon Nov 08 2010, 02:10 pm
how do i display this aray in the lCD? its different on the 16x2 lcd.
char digit[10]={1,2,3,4,5,6,7,8,9,0}; void main() { while(1); { initlcd(); cursorxy(3,4); putstr(digit[2]); /// eror how to do this? } }
[ Edited Mon Nov 08 2010, 02:17 pm ]
Mon Nov 08 2010, 02:24 pm
yes it is diffrent from all aspects its function is diffrent from other lcd
use putchar function for a single character
use putchar function for a single character
Mon Nov 08 2010, 02:42 pm
hi makoja if i want to display the content of an array how would i do that?
i tried but it doesnt display.. my code is posted below
i tried but it doesnt display.. my code is posted below
#include <AT89X51.H> #include "lcd.h" char digit[10]={1,2,3,4,5,6,7,8,9,0}; void main() { initlcd(); cursorxy(1,1); putstr(digit[2]); while(1); }
Mon Nov 08 2010, 03:11 pm
hi romel
try this
unsigned char digit[10]={'1','2','3','4','5','6','7','8','9','0'};
then it will display
try this
unsigned char digit[10]={'1','2','3','4','5','6','7','8','9','0'};
then it will display
Mon Nov 08 2010, 03:32 pm
i already tried that method error also
compiling clock.c...
CLOCK.C(11): error C214: illegal pointer conversion
Target not created
#include <AT89X51.H> #include "lcd.h" unsigned char digit[10]={'1','2','3','4','5','6','7','8','9','0'}; void main() { initlcd(); cursorxy(1,1); putstr(digit[3]); while(1); }
Mon Nov 08 2010, 03:39 pm
wee!!! helo majoka i see the problem instead of using putstr i used putchar and it works.. huhu my 6hours is focus in this problem.. hehe
if i had known by using putchar will solve this i will not spend my 6 hours in this line.. hehe but its okay.. hehe
if i had known by using putchar will solve this i will not spend my 6 hours in this line.. hehe but its okay.. hehe
#include <AT89X51.H> #include "lcd.h" unsigned char digit[10]={'1','2','3','4','5','6','7','8','9','0'}; void main() { initlcd(); cursorxy(1,1); putchar(digit[3]); while(1); }
[ Edited Mon Nov 08 2010, 03:40 pm ]
Mon Nov 08 2010, 03:44 pm
hi romel_emperado
i think u do not read my previous reply i mention that use putchar(); for single character as putstr(); is a function that receive strings address instead of single byte of data
obviously now ur problem should be solved
anyhow u learn from these 6 hours now u will not do this mistake in future orif do u understand it in a second
this is called learning
this is my reply in previous post
i think u do not read my previous reply i mention that use putchar(); for single character as putstr(); is a function that receive strings address instead of single byte of data
obviously now ur problem should be solved
anyhow u learn from these 6 hours now u will not do this mistake in future orif do u understand it in a second
this is called learning
this is my reply in previous post
use putchar function for a single character
romel_emperado like this.
Mon Nov 08 2010, 04:03 pm
hi romel_emperado
i think u do not read my previous reply i mention that use putchar(); for single character as putstr(); is a function that receive strings address instead of single byte of data
obviously now ur problem should be solved
anyhow u learn from these 6 hours now u will not do this mistake in future orif do u understand it in a second
this is called learning
this is my reply in previous postuse putchar function for a single character
majoka
its my mistake i did not properly read your post..
-------------------------------------------------------------------------------------------------------------
do u have idea on this on how to solve this problem? it is the same error as above
unsigned char days[3]={"Monday","tuesday","wednesday"};
unsigned char days[3]={'Monday','tuesday','wednesday'};
o tried using putchar and putstr but no luck.
Mon Nov 08 2010, 06:31 pm
try :
use putstr(days[1])....etc.
char* days[3]={"Monday","tuesday","wednesday"};
use putstr(days[1])....etc.
Mon Nov 08 2010, 06:42 pm
hi sham thanks it now okay and displaying.. let me ask a question.
what's with that "*" ? what is the explaination behind that? sorry Im noob.
what's with that "*" ? what is the explaination behind that? sorry Im noob.
Powered by e107 Forum System