S32k312 EVB switch

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S32k312 EVB switch

跳至解决方案
929 次查看
LEEYM
Contributor II

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?

 

LEEYM_0-1750381305556.png

 

标记 (1)
0 项奖励
回复
1 解答
917 次查看
LEEYM
Contributor II

I checked, and the switch seems to be working

It seems like the light is not completely extinguished and only the brightness is decreasing..

在原帖中查看解决方案

0 项奖励
回复
1 回复
918 次查看
LEEYM
Contributor II

I checked, and the switch seems to be working

It seems like the light is not completely extinguished and only the brightness is decreasing..

0 项奖励
回复