sunnypod 发表于 2014-6-20 18:42:59

LM35,有偏差修正

int potPin=A0;
int delayPeriod=2000;
void setup()
{

Serial.begin(9600);


}
void loop()
{

int n=analogRead(potPin);

float vol=n*(5.0/1023.0)*100+3;
Serial.print("tep;");
Serial.print(vol);
Serial.println("c");
delay( delayPeriod);
}



串口数据
24.99
你们也许猜到我在那个城市了?
页: [1]
查看完整版本: LM35,有偏差修正