当前位置: 首页 > news >正文

福田网站建设设计公司哪家好青岛的seo服务公司

福田网站建设设计公司哪家好,青岛的seo服务公司,软件开发流程和规范,如何靠做网站赚钱0、结果 说明:先来看看拍摄的显示结果,如果是你想要的,可以接着往下看。 1、外观 说明:本次使用的oled是0.96寸的,别的规格的屏幕不一定适用本教程,一般而言有显示白色、蓝色和蓝黄一起显示的&#xff0…

0、结果

说明:先来看看拍摄的显示结果,如果是你想要的,可以接着往下看。

1、外观

说明:本次使用的oled是0.96寸的,别的规格的屏幕不一定适用本教程,一般而言有显示白色、蓝色和蓝黄一起显示的,虽然dht11温湿度模块形态各异,但是代码都是适用的,因为它们的模块都是一样的。

2、连线

说明:只需要连接三根线。

uno————dht11

    5V--------------VCC
GND--------------GND

    D7--------------DATA

说明:只需要连接四根线。

uno————oled 0.96

    5V--------------VCC
GND--------------GND

 SCL--------------SCL

 SDA--------------SDA

3、源程序

说明:采用非阻塞方式编写,一定时间检测和显示一次温湿度数据,并将对应功能进行函数化,方便移植。

/****************************************dht11 part****************************************/
#include <dht11.h>                                      //include library
#define dht11Pin 7                                      //Define DHT11 sensor connection pins
#define dht11TimeInterval 1000                          //Detect the time interval of a tripdht11 DHT11;                                            //Instantiate an object
unsigned long dht11Times = 0;                           //Record the device running time
int dhtTemp = 0, dht11Humi = 0;                         //Storage temperature  //Storage humidity
/****************************************oled96 part****************************************/
#include <Arduino.h>                                                          //include library
#include <U8g2lib.h>                                                          //include library
#include <Wire.h>                                                             //include libraryU8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);#define oledTimeInterval 1000                                                 //Detect the time interval of a trip
unsigned long oledTimes = 0;                                                  // Record the device running time/****************************************set up and loop part*********************************/
void setup() {u8g2.begin();                                                               //Example Initialize the IIC
}
void loop() {getTempData();                                                              //Obtain the temperature and humidity valuesoledDisplayMath();                                                          //Display math
}
/****************************************oled96 part****************************************/
/*Display math*/
void oledDisplayMath() {if (millis() - oledTimes >= oledTimeInterval) {                              //This command is executed once in a whileoledTimes = millis();u8g2.setFont(u8g2_font_ncenB14_tr);                                         //u8g2_font_6x12_tru8g2.setFontDirection(0);u8g2.firstPage();do {u8g2.setCursor(0, 15);                                                    //0 means start at the first column and 15 means end at row 15u8g2.print("Temp:");u8g2.setCursor(64, 15);                                                    //0 means start at the first column and 15 means end at row 15u8g2.print(dhtTemp);u8g2.setCursor(96, 15);                                                    //0 means start at the first column and 15 means end at row 15u8g2.print(" C");u8g2.setCursor(0, 31);                                                    //0 means start at the first column and 15 means end at row 15u8g2.print("Humi: ");u8g2.setCursor(64, 31);u8g2.print(dht11Humi);u8g2.setCursor(96, 31);                                                    //0 means start at the first column and 15 means end at row 15u8g2.print(" %");} while ( u8g2.nextPage() );}
}
/****************************************dht11 part****************************************/
/*Obtain the temperature and humidity values*/
void getTempData() {if (millis() - dht11Times >= dht11TimeInterval) {dht11Times = millis();DHT11.read(dht11Pin);                               //Update all sensor informationdhtTemp = DHT11.temperature;dht11Humi = DHT11.humidity;Serial.print("Temperature: ");Serial.print(dhtTemp);Serial.print(" (C), ");Serial.print("Humidity: ");Serial.print(dht11Humi);Serial.println(" (%).");}
}

4、注意事项

说明:需要在线下载<u8glib.h>库文件和<dht11.h>库文件。

http://www.hrbkazy.com/news/30225.html

相关文章:

  • 秘密入口3秒自动转接连接廊坊seo整站优化
  • docker wordpress安装广东网站营销seo方案
  • 什么软件做高级网站网站seo博客
  • 莱州网站建设公司江苏网站推广公司
  • 哪个网站做医学培训好关键词爱站网
  • 高淳 网站建设竞价排名是按照什么来计费的
  • 网站专题设计稿员工培训课程
  • iis7.5添加php网站学历提升哪个教育机构好一些
  • wordpress创建自定义页面模板河南网站优化公司哪家好
  • 网站推广是怎么推广的软文营销代理
  • 扶风高端企业网站建设seo网站排名优化教程
  • 做电商网站有什么用北京网站优化服务
  • php建网站公司网站优化
  • 教育培训网站模板成都新站软件快速排名
  • 做网站优化最快的方式百度怎么做推广
  • 南昌市新农村建设网站注册网站怎么注册
  • 四川德立胜建设工程有限公司网站数据查询网站
  • 兖州网站建设seo标题优化关键词
  • 电子请柬网站开发为什么sem的工资都不高
  • 桓台网站推广策划方案网站
  • 做网站需要的资料网站建设是什么工作
  • 网站界面设计如何实现功能美与形式美的统一?网站建设计划书
  • wordpress图片压缩软件重庆二级站seo整站优化排名
  • 网站文件夹命名怎么做想要网站推广版
  • 安平网站建设优化企业官网怎么做
  • 网站建设的内容要怎么写百度网页版登录
  • 武功做网站seo模拟点击有用吗
  • 做韩国网站seo优化技术排名
  • 自己家的电脑宽带50m做网站服务器微营销推广方案
  • 易旅游网站建设推广营销app