Arduino 串口输出LM35温度
#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温度的更多相关文章
- ASCIITable: 演示 Arduino 串口输出的进阶功能
原文地址 - https://www.arduino.cc/en/Tutorial/ASCIITable ASCII字符表 本例展示了高级的串口打印功能,通过本功能可以在Arduino软件(IDE)的 ...
- arduino串口输出问题
- Arduino 串口通讯参考笔记 - Serial 类库及相关函数介绍
声明: 本ID发布的所有文章及随笔均为原创,可随意转载,单转载文章必须注明作者 aiyauto 及包含原文出处地址 http://www.cnblogs.com/aiyauto/p/7071712.h ...
- Arduino串口的一些高级用法
1.配置串口通信数据位.校验位.停止位通常我们使用Serial.begin(speed)来完成串口的初始化,这种方式,只能配置串口的波特率.而使用Serial.begin(speed, config) ...
- STC15系列通用-STC15F2K60S2/STCW4K32S4读取DHT11温湿度传感器数据串口输出代码实例工程免费下载
//为了方便大家调试,另附程序工程共大家下载,下载地址:https://www.90pan.com/b1908750 //************************** //程序说明:stc ...
- Arduino 串口的一些高级用法
来源: 1.配置串口通信数据位.校验位.停止位 通常我们使用Serial.begin(speed)来完成串口的初始化,这种方式,只能配置串口的波特率. 而使用Serial.begin(speed, c ...
- Arduino - 串口操作函数与示例代码大全
来源:https://blog.csdn.net/iracer/article/details/50334041 Arduino - 串口操作函数与示例代码大全 本文总结了Arduino常用串口操作函 ...
- TI CC2541的串口输出.
http://blog.csdn.net/feilusia/article/details/47431659 基本上看上面这个博客的. 重点是: 1. 关闭流控, 在npi.h里面, 将 #defin ...
- verilog实验3:AD转换后串口输出到PC端
一.实验任务 通过tcl549AD转换芯片将模拟电压信号转换为数字信号,并通过串口显示到电脑上.此AD转换芯片为串行转换芯片,且转换速率要和串口选择的速率匹配.等待串口发送完后,再进行下一次AD转换. ...
随机推荐
- scrapy-redis(一)
安装scrapy-redis pip install scrapy-redis 从GitHub 上拷贝源码: clone github scrapy-redis源码文件 git clone https ...
- Artem and Array CodeForces - 442C (贪心)
大意: 给定序列$a$, 每次任选$a_i$删除, 得分$min(a_{i-1},a_{i+1})$(无前驱后继时不得分), 求最大得分. 若一个数$x$的两边都比$x$大直接将$x$删除, 最后剩余 ...
- python记录_day14 内置函数二 迭代 二分法
一.匿名函数 形式: lambda 形参:返回值 lambda表示的是匿名函数. 不需要用def来声明, 一句话就可以声明出一个函数.匿名函数不是说一定没名字,而是他们的名字统一称为“lambda”, ...
- Django之转发和重定向
https://blog.csdn.net/gscsd_t/article/details/79389167 转发和重定向: 转发:一次请求和响应,请求的地址没有发生变化,如果此时刷新页面,就会出现重 ...
- leetcode-algorithms-24 Swap Nodes in Pairs
leetcode-algorithms-24 Swap Nodes in Pairs Given a linked list, swap every two adjacent nodes and re ...
- SpringBoot项目Shiro的实现(二)
在看此小节前,您可能需要先看:http://www.cnblogs.com/conswin/p/7478557.html 紧接上一篇,在上一篇我们简单实现了一个Springboot的小程序,但我们发现 ...
- 安卓——AppTheme
<?xml version="1.0" encoding="utf-8"?> <resources> <style name=&q ...
- webmagic 日志使用及maven项目中排除日志依赖
我用的Spring Boot maven构建的工程,默认引入了 <dependency> <groupId>org.springframework.boot</group ...
- 一些input用法
//设定选中范围someInput.setSelectionRange(0, 2); //只读<input type="text" value="2" r ...
- loj 10000 活动安排
****这是一个贪心题,把结束时间排个序,然后留出更多的时间给后面的活动. #include<cstdio> #include<cstring> #include<alg ...