Skip to main content
Visitor II
August 19, 2003
Question

Using For loop for Delay problem

  • August 19, 2003
  • 3 replies
  • 740 views
Posted on August 19, 2003 at 14:04

Using For loop for Delay problem

    This topic has been closed for replies.

    3 replies

    Visitor II
    August 19, 2003
    Posted on August 19, 2003 at 13:06

    Hi,

    I'm working on the ST7LITE05 using the COSMIC C compiler.

    I tried to simply blink a Led using the folowing code, but it seams that the controller doesn't getting out of the ''For'' loop.. does anyone knows why? (the ''for'' loop in just a delay loop..)

    int i;

    while (1) {

    for(i=0;i

    if (ValBit(PBDR,0)) ClrBit(PBDR,0); else SetBit(PBDR,0); //Blink The Led

    }

    Thanks

    Itamar

    Itamar_nsu@bezeqint.net

    [ This message was edited by: Itamar on 19-08-2003 16:37 ]

    Visitor II
    August 19, 2003
    Posted on August 19, 2003 at 13:55

    Hi,

    are you using the +lite option in the compiler parameters?

    Without this, things can go very bad!!!

    Simon
    Visitor II
    August 19, 2003
    Posted on August 19, 2003 at 14:04

    Well, i didn't.. thank u very much - it works!!!

    Have a nice day

    Itamar

    [ This message was edited by: Itamar on 19-08-2003 19:08 ]