too many actual parameters error

General discussion on mikroC.
Post Reply
Author
Message
nadia awad
Posts: 5
Joined: 13 Jul 2014 22:07

too many actual parameters error

#1 Post by nadia awad » 13 Jul 2014 23:12

Hi there,

I'm trying to get the following code working, however, I'm getting this error (too many actual parameters).
Could you please help with this.
Thanks a lot. Nadia

void main()
{
unsigned long Vin, mV;
unsigned char op[12];
unsigned char i,j,lcd[5];
TRISC = 0; // PORTC are outputs (LCD)
TRISA = 0xFF; // PORTA is input
// Configure LCD
Lcd_Init(&PORTC); // LCD is connected to PORTC
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1,1,"VOLTMETER");
Delay_ms(2000);
// Configure A/D converter. AN0 is used in this project
ADCON1 = 0x80; // Use AN0 and Vref=+5V
// Program loop
for(;;) // Endless loop
{
Lcd_Cmd(_LCD_CLEAR);
Vin = Adc_Read(0); // Read from channel 0 (AN0)
Lcd_Out(1,1,"mV = "); // Display "mV = "
mV = (Vin * 5000) >> 10; // mv = Vin x 5000 / 1024
LongToStr(mV,op); // Convert to string in "op"
// Remove leading blanks
j=0;
for(i=0;i<=11;i++)
{
if(op != ' ') // If a blank
{
lcd[j]=op;
j++;
}
}
// Display result on LCD
Lcd_Out(1,6,lcd); // Output to LCD
Delay_ms(1000); // Wait 1 second
}
}

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: too many actual parameters error

#2 Post by filip » 14 Aug 2014 09:06

Hi,

This is the written code in the older version of the compiler, please see the Lcd example given in the latest version of the compiler to see how to set the Lcd correctly.

Regards,
Filip.

Post Reply

Return to “mikroC General”