C Delay Code Execution

Discussion in 'C' started by NMartin, May 23, 2008.

  1. NMartin

    NMartin New Member

    Joined:
    May 23, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    I am trying to write a program in C for an M16C microcontroller. I want to delay the execution of a piece of code for maybe a millisecond then carry on with the program:

    P = 1
    wait 1 ms
    P = 0

    Does anyone have any ideas on how to do this and what header files I might need for the code?

    Thanks
     
  2. atul.sharma12

    atul.sharma12 New Member

    Joined:
    May 21, 2008
    Messages:
    15
    Likes Received:
    2
    Trophy Points:
    0
    Occupation:
    S/W Engg.
    Location:
    This Planet only!!!!
  3. NMartin

    NMartin New Member

    Joined:
    May 23, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I've tried using the sleep() function but it gives me an undeclared external error when I try to compile, I think its because I don't have the right header file included but I can't get <windows.h> to work.

    Also I don't seem to be able to access the web address attached.

    Thanks.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice