Benutzer-Werkzeuge

Webseiten-Werkzeuge


iot:micropython

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
iot:micropython [2021/05/03 07:01] – [Develop for / with Micropython] adminiot:micropython [2025/02/11 10:05] (aktuell) – [Asynchronous Programming mit uasyncio:] admin
Zeile 36: Zeile 36:
 </code> </code>
  
 +==== 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)
 +</code>
 +
 +Quelle: https://randomnerdtutorials.com/esp32-esp8266-pwm-micropython/
 +
 +==== Ping auf dem ESP32 ====
 +
 +  * https://gist.github.com/shawwwn/91cc8979e33e82af6d99ec34c38195fb
 +
 +==== Asynchronous Programming mit uasyncio: ====
 +
 +  * https://gpiocc.github.io/learn/micropython/esp/2020/06/13/martin-ku-asynchronous-programming-with-uasyncio-in-micropython.html
 +  * https://www.youtube.com/watch?v=2IW-ZEui4h4 -- How To Easily Do Asynchronous Programming With Asyncio In Python
 ==== MQTT auf dem ESP32: ==== ==== MQTT auf dem ESP32: ====
   * https://boneskull.com/micropython-on-esp32-part-2/   * https://boneskull.com/micropython-on-esp32-part-2/
Zeile 53: Zeile 78:
 </code> </code>
  
 +==== I2S Audio auf dem ESP32: ====
 +
 +  * https://www.youtube.com/watch?v=UXt27kOokh0 - MicroPython I2S Audio with the ESP32
 +  * https://github.com/miketeachman/micropython-i2s-examples
 +
 +==== BME280====
 +
 +  * https://randomnerdtutorials.com/micropython-bme280-esp32-esp8266/
  
 ==== DHT11/22 (ESP32)==== ==== DHT11/22 (ESP32)====
Zeile 107: Zeile 140:
 </code> </code>
  
 +==== Freien Speicher ermitteln ====
 +<code python>
 +>>> import gc
 +>>> gc.collect()
 +>>> gc.mem_free()
 +107488
 +>>> import micropython
 +>>> micropython.mem_info()
 +</code>
iot/micropython.1620025260.txt.gz · Zuletzt geändert: 2021/05/03 07:01 von admin