极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9189|回复: 0

LM35,有偏差修正

[复制链接]
发表于 2014-6-20 18:42:59 | 显示全部楼层 |阅读模式
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
你们也许猜到我在那个城市了?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|联系我们|极客工坊

GMT+8, 2026-6-14 07:24 , Processed in 0.044520 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表