Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] I have a problem related to Embedded C .

Status
Not open for further replies.

Rahul8558

Newbie level 1
Joined
Sep 23, 2019
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
13
I am getting error

C132 _'delay' : not in formal parameter list

Can someone help me to solve this problem?


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include<reg51.h>
sbit led =P1^0 ;
void main()
void delay(unsigned int);
{
 while(1)
 {
 led = 1 ;
 delay (250) ;
 led = 0 ;
 delay(250);
 }
}           
delay(unsigned int i)
{
unsigned int j ;
for(i=0;i<=8;i++)
for(j=0;j<=1750;j++)
}

 

hello,


maybe you want to do


Code:
delay(unsigned int i)
{
unsigned int j ;
for(i=0;i<=8;i++)
{
  for(j=0;j<=1750;j++);
 }
}
 

Paulfjujo has a fix for you but the real problem is this:
Code:
void delay(unsigned int);
I think you intended to create a function called 'delay' but the semicolon ended the definition and no code was produced. Later when you used the function it couldn't find it.

Brian.
 

This may not have been so clear; in the prototype of the delay function you missed the argument 'i' at the line 4 of your code.
 

I think the real problem is that the prototype for the function delay() can't be between main() and the opening curly brace.
It must be before main() or after the curly brace.

The space before the opening brace was in early C versions used to define the parameter types. Only the names were present inside the parentheses.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top