@@ -0,0 +1,1036 @@
+from uuid import getnode as get_mac%0Aimport mraa%0Aimport time%0Aimport redis%0Aimport config%0Aimport time%0Aimport json%0Aimport calendar%0A%0A%22%22%22 Reading pin value from Analog port 3%0A%09The resulting x value can be in the range of 3 to 75.%0A%09The sensor readings are real-time, no noticeable delay%0A%22%22%22%0A%0AlightSensor = mraa.Aio(3)%0AheatSensor = mraa.Aio(2)%0AtouchSensor = mraa.Aio(1)%0AsoundSensor = mraa.Aio(0)%0A%0Ar = redis.StrictRedis(host=config.RAW_QUEUE_HOST, port=config.RAW_QUEUE_PORT, db=0)%0Amacaddr = get_mac()%0Awhile(1):%0A%09data_tuple = %7B%7D%0A%09data_tuple%5B'sensor_id'%5D = str(macaddr)%0A%09data_tuple%5B'ts'%5D = str(calendar.timegm(time.gmtime()))%0A%0A%09data_tuple%5B'reading'%5D = str(lightSensor.read())%0A%09r.publish('light_sensor', json.dumps(data_tuple))%0A%0A%09data_tuple%5B'reading'%5D = str(heatSensor.read())%0A%09r.publish('heat_sensor', json.dumps(data_tuple))%0A%0A%09data_tuple%5B'reading'%5D = str(touchSensor.read())%0A%09r.publish('touch_sensor', json.dumps(data_tuple))%0A%0A%09data_tuple%5B'reading'%5D = str(soundSensor.read())%0A%09r.publish('sound_sensor', json.dumps(data_tuple))%0A%0A%09time.sleep(0.1)%0A

Use audio, heat, light and touch sensors in one script.