I am looking for something similar to this...
Code: Select all
#!/usr/bin/env python
import time
import os
import eeml
# Xively variables specific to my account.
API_KEY = 'API Key Here'
FEED = 'FEED # Here'
API_URL = '/v2/feeds/{feednum}.xml' .format(feednum = FEED)
# Continuously read data from the DHT22 sensor and upload
# the results to the Xively feed.
while True:
# Read the data from the sensor.
sensorData = .... // Call on the main method within the DHT_Driver.c file
temp_C = sensorData[0]
humidity = sensorData[1]
if DEBUG:
print("sensorData:\t", sensorData)
print("\n")
if LOGGER:
# Initialize the users Xively account.
pac = eeml.Pachube(API_URL, API_KEY)
# Prepare the data to be uploaded to the Xively
# account.
# temp_C & humidity are extracted from their indices
# above.
pac.update([eeml.Data(0, temp_C, unit=eeml.Celsius())])
pac.update([eeml.Data(1, humidity, unit=eeml.%())])
# Upload the data to the Xively account.
pac.put()
# Wait 30 seconds to avoid flooding the Xively feed.
time.sleep(30)Code: Select all
temp_C = sensorData[0]
humidity = sensorData[1]I am very unfamiliar with Python and I am just beginning C so if there are any suggestions and or positive criticism, please feel free to chime in.
[1]: http://www.adafruit.com/datasheets/DHT22.pdf
[2]: https://github.com/adafruit/Adafruit-Ra ... ruit_DHT.c