iot:micropython
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| iot:micropython [2019/10/14 02:40] – admin | iot:micropython [2025/02/11 10:05] (aktuell) – [Asynchronous Programming mit uasyncio:] admin | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| ====== MicroPython ====== | ====== MicroPython ====== | ||
| - | === MicroPython für esp8266 | + | [[iot: |
| + | |||
| + | ==== MicroPython für ESP8266 | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| + | |||
| + | |||
| + | * [[https:// | ||
| + | |||
| + | ==== Develop for / with Micropython ==== | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| + | * https:// | ||
| + | ==== Porting Micropython ==== | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| - | === Blink LED: === | + | ==== Blink LED: ==== |
| <code python> | <code python> | ||
| Zeile 23: | Zeile 36: | ||
| </ | </ | ||
| - | == MQTT auf dem ESP32: == | + | ==== LED Helligkeit per PWM regeln: ==== |
| + | |||
| + | <code python> | ||
| + | from machine import Pin, PWM | ||
| + | from time import sleep | ||
| + | |||
| + | frequency = 5000 # Hz: can be a value between 0 and 78125 | ||
| + | led = PWM(Pin(2), frequency) | ||
| + | |||
| + | while True: | ||
| + | for duty_cycle in range(0, 1024): #can be a value between 0 and 1023 (100%) | ||
| + | led.duty(duty_cycle) | ||
| + | sleep(0.005) | ||
| + | </ | ||
| + | |||
| + | Quelle: https:// | ||
| + | |||
| + | ==== Ping auf dem ESP32 ==== | ||
| + | |||
| + | * https:// | ||
| + | |||
| + | ==== Asynchronous Programming mit uasyncio: ==== | ||
| + | |||
| + | * https:// | ||
| + | * https:// | ||
| + | ==== MQTT auf dem ESP32: | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| Zeile 40: | Zeile 78: | ||
| </ | </ | ||
| + | ==== I2S Audio auf dem ESP32: ==== | ||
| - | === DHT11/22 (ESP32)=== | + | * https:// |
| + | * https:// | ||
| + | |||
| + | ==== BME280==== | ||
| + | |||
| + | * https:// | ||
| + | |||
| + | ==== DHT11/22 (ESP32)==== | ||
| * https:// | * https:// | ||
| <code python> | <code python> | ||
| Zeile 61: | Zeile 107: | ||
| print(msg) | print(msg) | ||
| | | ||
| - | | + | |
| - | sleep 2 | + | sleep(2) |
| </ | </ | ||
| - | == MicroPython to AWS-IOT == | + | ==== MicroPython to AWS-IOT |
| * https:// | * https:// | ||
| - | === Enthaltene Module (ESP32)=== | + | ==== Enthaltene Module (ESP32)==== |
| <code python> | <code python> | ||
| help(' | help(' | ||
| Zeile 94: | Zeile 140: | ||
| </ | </ | ||
| + | ==== Freien Speicher ermitteln ==== | ||
| + | <code python> | ||
| + | >>> | ||
| + | >>> | ||
| + | >>> | ||
| + | 107488 | ||
| + | >>> | ||
| + | >>> | ||
| + | </ | ||
iot/micropython.1571020809.txt.gz · Zuletzt geändert: von admin
