Giter VIP home page Giter VIP logo

dht11-dht22-python-library-orange-pi's Introduction

DHT22 Python library This simple class can be used for reading temperature and humidity values from DHT22 sensor on Orange PI.

Fork with some patches from https://forum.armbian.com/topic/5718-need-help-with-dht11-temp-sensor-and-python-code/

My Case of usage

Usage

Example:

from pyA20.gpio import gpio
from pyA20.gpio import port
 
import dht
import time
import datetime
 
# initialize GPIO
PIN2 = port.PA6
gpio.init()
 
# read data using pin
instance = dht.DHT(pin=PIN2)
 
while True:
    result = instance.read()
    if result.is_valid():
        print("Last valid input: " + str(datetime.datetime.now()))
        print("Temperature: %.2f C" % result.temperature)
        print("Humidity: %.2f %%" % result.humidity)
 
    time.sleep(1)

Please see tutorial: http://www.piprojects.xyz/temperature-sensor-orange-pi-python-code/

Source project https://github.com/ionutpi/DHT22-Python-library-Orange-PI

dht11-dht22-python-library-orange-pi's People

Contributors

ionutpi avatar jingl3s avatar vitalik-samets 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.