SHARE
TWEET

Untitled

a guest Oct 16th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import RPi.GPIO as GPIO
  2. import dht11
  3. import  time
  4.  
  5.  
  6. import medioex
  7. medioex.do_di_init()
  8. a = medioex.di_read(4)
  9. print (a)
  10.  
  11. # initialize GPIO
  12. GPIO.setwarnings(False)
  13. GPIO.setmode(GPIO.BCM)
  14. GPIO.cleanup()
  15.  
  16. # read data using pin 14
  17. instance = dht11.DHT11(pin = 26)
  18. result = instance.read()
  19.  
  20. if result.is_valid():
  21.     print("Temperature: %-3.1f C" % result.temperature)
  22.     print("Humidity: %-3.1f %%" % result.humidity)
  23.     time.sleep(10)
  24. else:
  25.     print("Error: %d" % result.error_code)
  26.     time.sleep(1)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top