Python Asyncio Sensors

Raspberry Pi / Python Open Kit Simulator ↗ All recipes
Tip: Ctrl+↵ to run
Python runs in your browser. Hit Run to execute — first run downloads the Python runtime (~10 MB), then it's instant. Note: GPIO calls won't actually toggle your Pi's pins from a browser. Use this to test logic, then run the .py on your Pi.

About this recipe

All three reads happen concurrently — total ~0.2s, not 0.35s

Libraries / imports

asyncio random

Hardware / pins

DHT22 BME280 HC-SR04

Key API calls

sleep() print()

How to run

Press Run — executes in a Web Worker. Edits auto-save.
Editor python edits auto-save
Output ready
Output will appear here after you click Run.