Altera_Forum
Honored Contributor
12 years agoTurn on 4 leds nios II
hello,
I have a FPGA Cyclone III ep3c25. I use NIOS II, I turn on the first LED. Now how to turn the 4 LEDs. i use this code to blink first led.#include <stdio.h># include "system.h"# include "altera_avalon_pio_regs.h"
int main()
{
printf("Hello from Nios II!\n");
int count=0;
int delay;
while(1)
{
IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE,count & 0x01);
delay=0;
while(delay < 2000000)
{
delay++;
}
count++;
}
return 0;
}