1

I have a TM4C123G board. I've set up a basic ARM assembly program in which the bits will shift either left (PC4, PC5, PC6) or right (down the opposite), lighting up differen LED's. I now would like to add a button to decide which of these patterns will be used while pressed. I'm struggling as far as how to initialize the GPIO for the button.

euniquity
  • 11
  • 2
  • gpio generally resets as an input, so it is already configured. making an led light up is harder than reading the gpio for a button, and you can make the leds light up? then do less work and read the gpio as an input. what is the real problem you are having? what did you try? – old_timer Oct 22 '22 at 22:06

1 Answers1

0

Generally speaking, to make use of a button (or any other peripheral) you need to work with their address.

It looks like that the TM4C board has user buttons. So you could try making use of them first, instead of buying a separate button/switch and connecting it to the GPIO.

If you must use the GPIO, please refer to this tutorial on How to use GPIO pins of TM4C

dracdc
  • 66
  • 3