Hello.
I'm using the S32k312 EVB board
I'm going to use an example of a switch
I don't think the if statement of the main loop is written
int main(void)
{
/* Initialize all pins using the Port driver */
Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);
Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 1U);
if(1 == Siul2_Dio_Ip_ReadPin(SW5_PORT, SW5_PIN) ){
Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 0U);
}
else{
Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 1U);
}
}
Debugging works properly, but the LED does not turn off when you press the switch.
Is there anything I missed?
已解决! 转到解答。