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.
工具/软件:Code Composer Studio
下面是我的连接图片:
到目前为止、我的代码是:
#include
#include
uint16_t adcRead ();
/**
* main.c
*
void main (void)
{
WDTCTL = WDTPW | WDTHOLD; //停止看门狗计时器
PM5CTL0 &=~LOCKLPM5;
P1DIR &=~(BIT1);
uint16_t reading_once;
reading_once = adcRead ();
while (1); //停止
}
uint16_t adcRead (){
ADCCTL0 = ADCSHT_6 | ADCON;
ADCCTL1 = ADCSHS_0 | ADCCONSEQ_0 | ADCSHP;
ADCCTL2 = ADCRES_2;
ADCMCTL0 = 1;
P1SEL0 |= BIT1;
P1SEL1 |= BIT1;
ADCCTL0 = ADCENC;
ADCCTL0 &=~(ADCSC);
ADCCTL0 |=(ADCSC);
//while (!(ADCIFG & ADCIFG));
返回 ADCMEM0;
}
我不是 EE,但看起来不错--一个带有(CD 指示灯?)的分压器 传感器。 我正在假设(?) 您将覆盖它、而不会看到变化。
我真的不相信无焊试验电路板、这就是我问实际输出电压是多少的原因。