A repository for MicroPython code that communicates with and relays information from the Texas Instruments TMP117/119 temperature sensor.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
863 B

import asyncio
from lib.topic_message import TMQueue
from async_tasks.general_tasks import measure_sensors
async def main_wifi(uuid, sensors, mqtt_client, temperature_topic, inbound_topic):
from async_tasks.wireless_tasks import mqtt_publish_tmsgs
outbound_queue = TMQueue()
asyncio.create_task(measure_sensors(sensors, 1, uuid, outbound_queue, temperature_topic))
asyncio.create_task(mqtt_publish_tmsgs(mqtt_client, outbound_queue, 0.5))
while True:
await asyncio.sleep(5)
async def main_wired(uuid, sensors, temperature_topic, inbound_topic):
from async_tasks.wired_tasks import usb_send_data
outbound_queue = TMQueue()
asyncio.create_task(measure_sensors(sensors, 1, uuid, outbound_queue, temperature_topic))
asyncio.create_task(usb_send_data(outbound_queue, 0.5))
while True:
await asyncio.sleep(5)