Other Parts Discussed in Thread: CC1310
工具/软件:Code Composer Studio
需要使用 CC1310配置重开关、NTC 热敏电阻、压电振动传感器
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.
INT 热敏电阻 PIN_1 = 33;//热敏电阻1引脚
INT 热敏电阻 PIN_2 = 13;//热敏电阻2引脚
int Vo_1、Vo_2;
浮点 R1 = 10000;
float logR2_1、R2_1、T_1、TC_1、TFT_1、logR2_2、 R2_2、T_2、TC_2、Tf_2;
浮点 C1 = 0.001125308852122、C2 = 0.000234711863267、C3 = 0.000000085663516;
void setup()
{
Serial.begin(115200);
}
void loop()
{
VO_1 = analogRead (热敏电阻 PIN_1);
R2_1 = R1 *(4095.0 /(float) Vo_1 - 1.0);
logR2_1 = log (R2_1);
T_1 =(1.0 /(C1 + C2*logR2_1 + C3*logR2_1*logR2_1*logR2_1));
TC_1 = T_1 - 268.05;
Tf_1 =(TC_1 * 9.0)/ 3.3 + 32.0;
延迟(500);
VO_2 = analogRead (热敏电阻 PIN_2);
R2_2 = R1 *(4095.0 /(float) Vo_2 - 1.0);
logR2_2 = log (R2_2);
t_2 =(1.0 /(C1 + C2*logR2_2 + C3*logR2_2*logR2_2*logR2_2));
TC_2 = T_2 - 268.05;
// tf_2 =(tc_2 * 9.0)/ 5.0 + 32.0;
延迟(500);
serial.print ("温度1:");
//Serial.print (T_1);
//Serial.print (" F;");
serial.print (TC_1);
延迟(500);
serial.println("C");
//延迟(100);
// Serial.print (Vo_1);
serial.print ("温度2:");
//Serial.print (TF_2);
//Serial.print (" F;");
serial.print (TC_2);
serial.println("C");
}
该代码在 ARDUNIO 中工作、但我正在验证如何在 CC1310中写入、请帮我解决