Giter Site home page Giter Site logo

dht's Introduction

DHT Library for STM32 HAL

ko-fi

This is the DHT (Humidity-Temperature) sensors STM32 HAL Library

How to use this Library:

  • Select "General peripheral Initalizion as a pair of '.c/.h' file per peripheral" on project settings.
  • Enable a gpio pin as external interrupt on both Rising and Falling edge.
  • Enable a timer as normal mode.
  • Include Header and source into your project.
  • Config "dhtConf.h".
  • Create your DHT_t struct.
  • Put DHT_pinChangeCallBack(your struct) in external callback function.
  • Call DHT_init( .. .. .. ).
  • Read data by DHT_readData(&temp,&humid)
#include "DHT.h"
DHT_t     am2301;
bool      am2301_ok;


void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
  if(GPIO_Pin == am2301.pin)
  {
    DHT_pinChangeCallBack(&am2301);
  }
}

int main()
{
  DHT_init(&am2301,DHT_Type_AM2301,&htim7,72,AM2301_GPIO_Port,AM2301_Pin); 
  while(1)
  {
    HAL_Delay(5000);
    float t,h;
    am2301_ok = DHT_readData(&am2301,&t,&h);  
  }
}

Reversion History:
(2.0.0)
rewrite completly and Add external interrupt to reading pulses.

(1.0.0)
First Release.

dht's People

Contributors

nimaltd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dht's Issues

tim

سلام فایل
tim.h
رو هم باید به کتابخونه اضافه کنید.
چه کتابخونه ای هستش؟

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.