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++
12600 Discussions

Software to manage input buttons

Altera_Forum
Honored Contributor II
1,103 Views

Hello dear people from Altera forums =) Another question by someone who is just starting. 

 

I made a C program for the NIOS to blink some leds and stuff like that on my BeMicro FPGA using my keyboard as input. 

 

Now i want my program to recieve the input from a button that will be connected to the FPGA pins.  

 

I already did the Design on quartus II and generated my SOF file, now i need to do something like, when i click one button one led blinks, when i click another button the other led blinks. 

 

(I just need help with how my program can see that the button was clicked) 

 

I am kinda lost over here on how to do that. 

 

Thanks for the help and i am loving this place :D
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
247 Views

Just like you use the IOWR_ALTERA_AVALON_PIO_DATA(base, data) macro to turn on or off the LEDs, you can use the IORD_ALTERA_AVALON_PIO_DATA(base) macro on your buttons PIO to read the buttons state.

0 Kudos
Altera_Forum
Honored Contributor II
247 Views

Thanks, it was exactly what i needed

0 Kudos
Reply