#include "stdlib.h"
float temp = 0.0;
float maxtemp = 0.0;
float mintemp =100.0; // the setup routine runs once when you press reset:
void setup() {
Serial.begin();
Serial.println(F("reading temperature begin. \n")); } // the loop routine runs over and over again forever:
void loop() { static unsigned long sensortStamp = ; if(millis() - sensortStamp > ){
sensortStamp = millis();
// read the LM35 sensor value and convert to the degrees every 100ms. int reading = analogRead(); //把LM35的输出端连接到了A0,所以这里是analogRead(0)
temp = reading *0.0048828125*;
if(temp >= maxtemp)
maxtemp = temp;
if(temp <= mintemp)
mintemp = temp;
Serial.print(F("Real Time Temp: "));
Serial.print(temp);
Serial.print(F(" Max Temp: "));
Serial.print(maxtemp);
Serial.print(F(" Min Temp: "));
Serial.println(mintemp);
} }

Arduino 串口输出LM35温度的更多相关文章

  1. ASCIITable: 演示 Arduino 串口输出的进阶功能

    原文地址 - https://www.arduino.cc/en/Tutorial/ASCIITable ASCII字符表 本例展示了高级的串口打印功能,通过本功能可以在Arduino软件(IDE)的 ...

  2. arduino串口输出问题

  3. Arduino 串口通讯参考笔记 - Serial 类库及相关函数介绍

    声明: 本ID发布的所有文章及随笔均为原创,可随意转载,单转载文章必须注明作者 aiyauto 及包含原文出处地址 http://www.cnblogs.com/aiyauto/p/7071712.h ...

  4. Arduino串口的一些高级用法

    1.配置串口通信数据位.校验位.停止位通常我们使用Serial.begin(speed)来完成串口的初始化,这种方式,只能配置串口的波特率.而使用Serial.begin(speed, config) ...

  5. STC15系列通用-STC15F2K60S2/STCW4K32S4读取DHT11温湿度传感器数据串口输出代码实例工程免费下载

    //为了方便大家调试,另附程序工程共大家下载,下载地址:https://www.90pan.com/b1908750 ​ //************************** //程序说明:stc ...

  6. Arduino 串口的一些高级用法

    来源: 1.配置串口通信数据位.校验位.停止位 通常我们使用Serial.begin(speed)来完成串口的初始化,这种方式,只能配置串口的波特率. 而使用Serial.begin(speed, c ...

  7. Arduino - 串口操作函数与示例代码大全

    来源:https://blog.csdn.net/iracer/article/details/50334041 Arduino - 串口操作函数与示例代码大全 本文总结了Arduino常用串口操作函 ...

  8. TI CC2541的串口输出.

    http://blog.csdn.net/feilusia/article/details/47431659 基本上看上面这个博客的. 重点是: 1. 关闭流控, 在npi.h里面, 将 #defin ...

  9. verilog实验3:AD转换后串口输出到PC端

    一.实验任务 通过tcl549AD转换芯片将模拟电压信号转换为数字信号,并通过串口显示到电脑上.此AD转换芯片为串行转换芯片,且转换速率要和串口选择的速率匹配.等待串口发送完后,再进行下一次AD转换. ...

随机推荐

  1. A Chess Game POJ - 2425

    Let's design a new chess game. There are N positions to hold M chesses in this game. Multiple chesse ...

  2. grid 用于同一用例在不同测试环境下的测试结果

    步骤: 1.http://www.seleniumhp.org/download   下载selenium standalone server 2.配置java环境 3.运行selenium serv ...

  3. dedecms自定义表单时间时间戳值类型的转换方法

    找网站找的别人的方法,记录一下 修改/dede/templets/diy_list.htm,在第42行else前面加上以下代码: else if($fielddata[1]=='datetime') ...

  4. input事件在ie9以下不兼容问题完美解决

    上周四好不容易加了几天班把刚接手的一个pc页面做完,周五同事说要兼容ie7~ie9,结果在上面一跑,输入都没法输入. 我的需求是用6个span作为虚拟的密码输入框,实际上是用一个藏在页面里的input ...

  5. CCF-CSP 201312-5 I'm stuck !

    I'm stuck 试题编号: 201312-5 试题名称: I’m stuck! 时间限制: 1.0s 内存限制: 256.0MB 问题描述: 问题描述 给定一个R行C列的地图,地图的每一个方格可能 ...

  6. python爬虫---requests库的用法

    requests是python实现的简单易用的HTTP库,使用起来比urllib简洁很多 因为是第三方库,所以使用前需要cmd安装 pip install requests 安装完成后import一下 ...

  7. Hive QL的操作

    一.数据定义DDL操作 创建表: --create table为创建一个指定名字的表 create(external) table table_name --external关键字可以让用户创建一个外 ...

  8. 洛谷P1075 质因数分解

    题目描述 已知正整数n是两个不同的质数的乘积,试求出两者中较大的那个质数. 输入输出格式 输入格式: 一个正整数n. 输出格式: 一个正整数p,即较大的那个质数. 输入输出样例 输入样例#1: 复制 ...

  9. Python日志、序列化、正则模块

    使用Python内置模块的目的:拿来别人已经写好的模块功能,直接import内置模块使用,简化程序,避免重复造轮子的过程,提示自己的开发效率: 一. loging日志模块: 1. loging模块可以 ...

  10. 3G 4G 5G中的网络安全问题——文献汇总

    Modeling and Analysis of RRC-Based Signalling Storms in 3G Networks 还是使用状态机模型来做恶意UE识别 https://san.ee ...