Hi.
i'm tring to controll RGB LED on board by SW1 and SW2. i know that SW2 is connected to PF0 and SW1 is connected to PF4.
RGB LED is connected to PF1-PF3.
i attached my code here, any advice of resolving the problem will be thankfull.
int main(void)
{
uint8_t ui8LED =8;
SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, GPIO_PIN_0|GPIO_PIN_4);
while(1)
{
// Make SW2 and SW1 rissing edge triggerd interrupt
GPIOIntTypeSet(GPIO_PORTA_BASE,GPIO_PIN_0|GPIO_PIN_4, GPIO_RISING_EDGE);
// Read the current state of SW2 and SW1
GPIOPinRead(GPIO_PORTF_BASE, GPIO_PIN_0|GPIO_PIN_4);
{
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, ui8LED);
SysCtlDelay(2000000);
if (ui8LED == 2) {ui8LED =4;} else {ui8LED = ui8LED*2;}
}
}
}