We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
hi can anyone tell me wat does this error mean??? C214:'argument':conversion:pointer to non pointer mean??
#include <REG52.H> #define B #define ST_CNTRL P1 sfr ldata = 0x80;
sbit rs = P3^7; sbit rw = P3^6; sbit en = P3^5; sbit busy = P0^7;
//--------------Funtion declaration void MSDelay (unsigned int); //Delay void lcdcmd (unsigned char value); void lcddata (unsigned char value); void lcdready (); void stepper(unsigned char k); void antistepper(unsigned char k) ;
void delay(void); unsigned char getkey ();
unsigned char countl,countr,count,key=0,Data1,Data2,Funct,Ans ; //Serially recieved data unsigned int R1,R2; unsigned char idata keypad[4][4]= { '1','2','3','/', '4','5','6','*', '7','8','9','-', 'Z','0','X','+',}; void main() { lcdcmd(0x38); lcdcmd(0x0e); lcdcmd(0x01); lcdcmd(0x06); lcdcmd(0x83); P2=0x00; R1=P2;
while(1) { if(R1<-30) { lcddata("ERROR"); } else if(R1>60) { lcddata("ERROR"); } else if(R1==-30) { count=30; stepper(); lcddata("TEMP -30"); MSDelay(100); lcddata("RES 25160"); getkey(); P2=0x00; R2=P2; if(R2=='Z') { count=30; antistepper(); return; } } }
} void MSDelay (unsigned int value) // Delay routine { unsigned int x,y; for (x=0;x<900;x++) for (y=0;y<value;y++); }
void lcdcmd (unsigned char value) { lcdready(); ldata = value; rs = 0; rw = 0; en = 1; MSDelay(1); en = 0; return; }
void lcddata (unsigned char value) { lcdready(); ldata = value; rs = 1; rw = 0; en = 1; MSDelay(1); en = 0; value=& value++; return; }
void stepper(unsigned char k) { for(k=0;k<count;k++) { P1 = 0x66; delay(); P1 = 0xcc; delay(); P1 = 0x99; delay(); P1 = 0x33; delay(); } }
void delay(void) { unsigned int i,j;
for(i = 0; i<0x20; i++) { for(j = 0; j<0x20; j++) { } } }
void antistepper(unsigned char k) { for(k=0;k<count;k++) { P1 = 0x33; delay(); P1 = 0x99; delay(); P1 = 0xCC; delay(); P1 = 0x66; delay(); } }
void lcdready () { busy = 1; rs = 0; rw = 1; while (busy == 1) { en = 0; MSDelay(1); en = 1; } return; }
unsigned char getkey () // Routine to read matrix keyboard { unsigned char colloc, rowloc; TMOD = 0x20; TH1 = -3; SCON = 0x50; TR1 = 1;
P2 = 0xff; do { P2 = 0x0f; //Wait untill all keys are released colloc = P2; colloc &= 0x0f; } while (colloc != 0x0f);
do { do { MSDelay (1); colloc = P2; colloc &= 0x0f; } while (colloc == 0x0f); //Check whether any ket is pressed MSDelay (1); colloc = P2; colloc &= 0x0f; //Confirm whether any ket is pressed after delay } while (colloc == 0x0f); //to aviod spikes
while(1) { P2 = 0xfE; //get the row presses colloc = P2; colloc &= 0xf0; if (colloc != 0xf0) { rowloc = 0; break; } P2 = 0xfd; colloc = P2; colloc &= 0xf0; if (colloc != 0xf0) { rowloc = 1; break; } P2 = 0xfb; colloc = P2; colloc &= 0xf0; if (colloc != 0xf0) { rowloc = 2; break; } P2 = 0xf7; colloc = P2; colloc &= 0xf0; rowloc = 3; break; } //get the coloum presses if (colloc == 0xe0) key = (keypad[rowloc][0]); else if (colloc == 0xd0) key = (keypad[rowloc][1]); else if (colloc == 0xb0) key = (keypad[rowloc][2]); else key = (keypad[rowloc][3]);
return(key); }
what i am doing here is when using a keypad we enter the no as -30 it shud make the stepper motor rotate for 30 steps as well as display the temp value and resistance value as u can see in the code..the stepper motor is inturn mechanical connected to multi turn potentiometer so here i am make a device which is a microcontroller based automated resistance box
So which part of "using proper tags" was so hard to understand that you couldn't manage to do it? I mean: look at your post. Does that really look like your source code?
And while at it, did it really not occur to you that the original error message has a line number associated with it, and that it might be important to tell people what line number that was?
Even if the code is almost totally unreadable, because of the lack of formatting, it's obvious that you have errors.
This function expects an unsigned character as parameter. That is one single character.
void lcddata (unsigned char value);
This call does not send a single character, but a pointer to an array of characters:
lcddata("ERROR");
Why shouldn't the compiler complain when you send a pointer to a function that isn't expecting a pointer?
wouldn't VALUE=&VALUE++ help??i mean it increments the value and display the whole thing isn't it??And i am sorry tat i couldnt put it in proper format.
VALUE and &VALUE are two different things. &VALUE is the address of VALUE.
Do get a good book about the C language. This isn't a problem with embedded programming, but basic knowledge about C.
And i am sorry ,i am not able to put in proper format I mean it looks proper on my editor but on preview it looks unformatted.And i have no idea as to how to correct it by the way i tot by lookin at my entire code u mite find it easy to help me decipher the error in the code.
I can't see that you have tried to use any "pre" "/pre" tags in your posts. You do notice the comments about these tags around the source code - the information is clearly visible directly about the message textbox.
i am not able to put in proper format I mean it looks proper on my editor but on preview it looks unformatted
sure you are able, all it requires is that you read the text in the yellow field of the reply window "Place source code source code between ..."
Erik