This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CCS/MSP430G2553:滑块编程

Guru**** 2581355 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/643030/ccs-msp430g2553-slider-programming

部件号:MSP430G2553

工具/软件: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

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好,Kartik,
    在您的代码中,您检测到未触摸按钮以关闭LED指示灯(“TI_Capt_Button”(&one_button)=0")。

    此致,
    现金Hao