I'm developing an application which interacts with raspberry pi.I need to get the temperature and humidity sensor readings from raspberry pi, for that I wrote this code.(I'm using python 2.7)
import RPi.GPIO as GPIO
import dht11
import time
import datetime
# initialize GPIO
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.cleanup()
# read data using pin 4
instance = dht11.DHT11(pin=4)
result = instance.read()
if result.is_valid():
#print("Last valid input: " + str(datetime.datetime.now()))
print("Temperature: %d C" % result.temperature)
print("Humidity: %d %%" % result.humidity)
else:
print "invalid"
But the problem is I can't add RPi.GPIO library to Pycharm, It's available in python Interpreter page but couldn't download to the IDE.So I downloaded it from https://pypi.python.org/pypi/RPi.GPIO page then I didn't find any tutorial on how to add it to the IDE, can anyone please help me.