MTH01 温湿度传感器


csharp展开代码/*
  Made on Apr 04, 2021
  By MehranMaleki @ Electropeak
  https://electropeak.com/learn/
*/
//  Sensor top view
//  CS     -  On/Off   1|°     --------------   [][][][]
//  SCK    -  CLK      2|°    [              ]  [][][][]
//  SDAT   -  MOSI     3|°    [              ]  [][][][]
//  Reset  -  Reset    4|°    [              ]  [][][][]
//  VSS    -  GND      5|°     --------------   [][][][]
//  VDD    -  +5V      6|°                       °    °
//                        -----------------------------
//Arduino connections
// CS    ->  7
// SCK   ->  13
// SDAT  ->  11
// Reset ->  NC
// VSS   ->  GND
// VDD   ->  5V
#include <Arduino.h>
#include "MTH01.h"
#define mth01_pin 7   // define CS pin
MTH01 mth01;
void setup()
{
  Serial.begin(9600);
  Serial.println("MTH-01 High Sensitivity Humidity & Temperature Sensor Module");
  mth01.begin(mth01_pin);   // Start the Sensor
}
void loop()
{
  Serial.print(" T = ");
  Serial.print(mth01.getTemperature());
  Serial.write("\xC2\xB0");   // The Degree symbol
  Serial.print("C");
  Serial.print("\t H = ");
  Serial.print(mth01.getHumidity());
  Serial.println("%");
  delay(5000);
}
csharp展开代码https://docs.qq.com/sheet/DUEdqZ2lmbmR6UVdU?tab=BB08J2


本文作者:Dong
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC。本作品采用《知识共享署名-非商业性使用 4.0 国际许可协议》进行许可。您可以在非商业用途下自由转载和修改,但必须注明出处并提供原作者链接。 许可协议。转载请注明出处!