工具/软件:Code Composer Studio
我的主要目标是拥有一个滑块功能,即触摸一个LED时,它会亮起,然后当我触摸下一个LED时,它也会亮起,之后,当我再次触摸任何一个LED时,它会关闭。 我是用其中一个按钮来实现的-一个按钮,但用two_button不会实现。 请帮我调试代码。 在while循环中,我有:
#ifdef element_characterization模式
//获取元素表征的原始增量计数
TI_Capt_Custom(&ON_BUTTON,&dCnt1);
//__no_operation();//在此处设置断点
TI_Capt_Custom(&Two_button,&dCnt2);
__no_operation();//在此处设置断点
#endif
#ifndef element_characterization模式
IF (TI_CAPT_BUTTON (&ONE_BUTTON)=1||TI_CAPT_BUTTON (&two_BUTTON)=1)
{
//p=;
IF (n=0&&TI_Capt_Button (&one_button)=1){
P1OUT+= BIT0;//打开LED
N=1;
}
如果(n1==0&&TI_Capt_Button(&two_button)=1){
P1OUT+= BIT1;//打开LED
N1=1;
}
}否则,如果(TI_Capt_button(&on_Button)=0)
{
P1OUT &=BIT0;//关闭LED
N=0;}
否则IF (TI_Capt_Button (&two_button)=0){
P1OUT &=BIT1;//关闭LED
N1=0;}
}
#endif