#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. [LintCode] Linked List Cycle(带环链表)

    描述 给定一个链表,判断它是否有环. 样例 给出 -21->10->4->5, tail connects to node index 1,返回 true. 这里解释下,题目的意思, ...

  2. Django模型类之models字段类型和参数以及元数据meta

    models之字段类型和参数 示例: # class Test(models.Model): # courses_test # """测试学习用""& ...

  3. python记录_day16 类的成员

    一.变量 1.实例变量(又叫字段.属性) 创建对象时给对象赋值 形式: self.xxx = xxx 访问: 对象名.xxx     只能由对象访问 class Person: def __init_ ...

  4. iptables -F 与 -X 区别

    test: 1.iptables 初始化 2.iptables -X (第一次) 错误原因是自定义链表(test)不为空 3.iptables -F 4.iptables -X ok,实验结束 实验报 ...

  5. 论raw_input与input之间的缠缠绵绵

    例子1:py2.7中,raw_input输入整数,返回的是str. input1=raw_input("raw_input:") print(type(input1)) print ...

  6. Mac OS下安装和配置MongoDB

    安装和配置教程: 参考地址:https://blog.csdn.net/yibowanbo/article/details/80233030 可视化管理工具: 地址:https://blog.csdn ...

  7. Spring Boot 是什么?

    Spring Boot 2.0 的推出又激起了一阵学习 Spring Boot 热,那么, Spring Boot 诞生的背景是什么?Spring 企业又是基于什么样的考虑创建 Spring Boot ...

  8. python 日期操作【转】

    SQLite中的时间日期函数这是我学习SQLite时做的笔记,参考并翻译了Chris Newman写的<SQLite>中的<Working with Dates and Times& ...

  9. 几种常见的开源软件许可协议(GPL, LGPL, Apache License, BSD)

    GPL GPL授予程序接受人以下权利,或称“自由”: * 以任何目的运行此程序的自由 * 以学习程序工作机理为目的,对程序进行修改的自由(能得到源代码是前提) * 再发行复制件的自由 * 改进此程序, ...

  10. mysql 5.7版本的下载安装

    因为这次开发新的项目,需要用到mysql,因为之前用的都是oracle,所以学习下mysql的下载安装,在此留下一点记录,方便以后的回顾 一:mysql的下载地址:https://dev.mysql. ...