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.

problem in keil uversion3 when compiling the C programme

Status
Not open for further replies.

cont

Newbie level 2
Joined
Jul 1, 2012
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,299
Hi experts ,
i am using Keil uversion3. I wrote the program in c , but when compiling this programme it gave me these messages:

compiling pwm.c...
pwm.c(1): warning C318: can't open file 'regex.h'
PWM.C(3): error C129: missing ';' before 'pwm'
pwm.c - 1 Error(s), 1 Warning(s).

please tell me what to do and thank in advance
 

is the file 'regex.h'in the same folder as c file, if nt try tat i guess.
for other problem post the code here there is syntax error sumwhere perhaps.
 
  • Like
Reactions: cont

    cont

    Points: 2
    Helpful Answer Positive Rating
Than you partzz for regarding my problem
the file 'regex.h' in the same folder as c, and here is the c prog
#include <regex.h>
#include <stdio.h>
viod pwm (unsigned char);
viod main
{
p2=0x00;
while(1)
{
unsigned char msec;
unsigned char nsec;
msec=100;
nsec=100-msec;
p2-0x01;
pwm(msec);
p2=0x00;
pwm(nsec);
}
}
void pwm(unsigned char ms)
{
unsigned int i;
for(i=0;i<ms<i++)
{
TMOD=0x01;
TH0=0xFC;
TL0=0x67;
TR0=0x01;
while(TF0==0x00);
TR0=0x00;
TF0=0x00;
}
}
 

If the header is in the same folder then use #include "regex.h" instead of #include <regex.h>
 

Code:
viod pwm (unsigned char);
viod main

u hav written viod instead of void.
also post your code b/w # sign on top of your edit window

- - - Updated - - -

If the header is in the same folder then use #include "regex.h" instead of #include <regex.h>

i hav microvision 4 and i hav my file in same folder as c and by compiler accepts both <font.h> and "font.h".is microvision 3 diff?
 

I don't have uvision3 but in uvision 4 it doesn't work (I just tried it) and this it the case with a few compilers I have worked with , <> searches in the predefined system path while "" searches in the same folder
 

I dont know what the hell you wrote..

Code:
[COLOR=#FF0000]#include <reg52.h>[/COLOR]
#include <stdio.h>
[COLOR=#FF0000]#define pw P2[/COLOR]
void pwm(unsigned char ms);
[COLOR=#008000]void main()[/COLOR]
{
[COLOR=#008000]pw=0x00;[/COLOR]
while(1)
 {
  unsigned char msec;
  unsigned char nsec;
  msec=100;
  nsec=100-msec;
[COLOR=#FF0000]  pw=0x01;[/COLOR]
  pwm(msec); 
  pw=0x00;
  pwm(nsec);
 }
}
void pwm(unsigned char ms)
{
 unsigned int i;
 for(i=0;i<ms<i++)
 {
   TMOD=0x01;
   TH0=0xFC;
   TL0=0x67;
   TR0=0x01;
   while(TF0==0x00);
   TR0=0x00;
   TF0=0x00;
 }
}
Try this..
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top