199k views
0 votes
Write a code in code composer studio for the interface of the membrane

keypad and tm4c123 Tiva board.

User Prembo
by
7.5k points

1 Answer

0 votes

Final answer:

To interface a membrane keypad with the tm4c123 Tiva board using Code Composer Studio, you can use the GPIO pins of the microcontroller to read the button presses. Here's an example code.

Step-by-step explanation:

To interface a membrane keypad with the tm4c123 Tiva board using Code Composer Studio, you can use the GPIO pins of the microcontroller to read the button presses. Here's an example code:

#include <tm4c123gh6pm.h>

void keypad_init(void)
GPIO_PIN_5);
GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_0

int main(void)
{
unsigned char c;
keypad_init();
while(1)
{
s[0]='0';
c=0;

GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_5,0x20);
if(GPIOPinRead(GPIO_PORTB_BASE,GPIO_PIN_0)) c=1;
GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_5,0x00);

...
}

User Adorn
by
7.7k points