Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

blinking leds, problem in code C

hi everybody, i'm a newbie.

I'm trying to design a simple blinking leds pattern by using the red leds array on the DE2 kit using CycloneII ,say the leds array begin to blink from the left to the right.

I've known already about NiosII soft processor and the SOPC buider, but I got stuck in writing code in C. I don't know how to create a time delay in my code :confused: , I wonder if I can use the CLOCK_50 ? and what is the best way to do this ?

please help!

thanks.

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    may be this code can help you.

    int delay;

    while(1)

    {

    delay = 0;

    while(delay < 2000000)

    {

    delay++;

    }