Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12748 Discussions

blinking leds, problem in code C

Altera_Forum
Honored Contributor II
1,109 Views

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.
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
415 Views

may be this code can help you. 

 

 

int delay; 

while(1) 

delay = 0; 

while(delay < 2000000) 

delay++; 

}
0 Kudos
Reply