This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

compling error query

hi can anyone tell me wat does this error mean???
C214:'argument':conversion:pointer to non pointer mean??

Parents
  • #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

Reply
  • #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

Children