Forum Discussion
Altera_Forum
Honored Contributor
17 years agoEasy nios design with buttons
Hello, I am a newbie with Quartus II and Nios II and I have been trying to do an easy nios design in order to light on a led when pressing a button. I am working on the Altera Cyclone III EP3C2...
Altera_Forum
Honored Contributor
17 years agotry this:
# include "system.h"# include "altera_avalon_pio_regs.h"# include "alt_types.h"# include "stdio.h"# include "stdlib.h" int alt_main (void){ alt_u8 button = 0x2; while(1){ button = IORD_ALTERA_AVALON_PIO_DATA(BUTTON_PIO_BASE); IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE, button); } }