Coder Social home page Coder Social logo

libdht's Introduction

libdht

Abstraction of the Adafruit DHT11/22 Python accessor

Usage

include "dht_read.c"

Link your application to libdhtsensor.so

dht_read(char *pin, int type, float *, float *)

pin is a string representing the BBB pin you are using type is either DHT11 or DHT22 The two float pointers are to store humidity and temperature as measured

It returns 0 on succes, and < 0 on an error

About

This library is created using the original C code from Adafruit. They use python as the interface, but the C code works for C/C++ just as well.

Right now, it only works with a BeagleBone Black, but I will port it to Raspberry PI when I get the chance. It would work fine for a RPI, but it does some PIN figuring out based on the BBB, so that's the restriction.

You must run as root. The original code makes some assumptions about how GPIO works, due to how you read and write using a memory map and timings.

libdht's People

Contributors

buelowp avatar

Watchers

 avatar

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.