Forum Discussion

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

Software to manage input buttons

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

2 Replies

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

    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.