hardware:microcontroller_mcu
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| hardware:microcontroller_mcu [2023-03-02 16:13:08] – manfred | hardware:microcontroller_mcu [2023-04-08 03:32:45] (aktuell) – gelöscht manfred | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== Microcontroller (MCU) ====== | ||
| - | |||
| - | Ursprünglich hatte man MCUs in [[https:// | ||
| - | Neuere MCUs werden üblicherweise mit [[https:// | ||
| - | |||
| - | |||
| - | ===== Atmel / Arduino ===== | ||
| - | |||
| - | [[https:// | ||
| - | |||
| - | |||
| - | ===== Python + ESP32 ===== | ||
| - | |||
| - | * Docs: [[https:// | ||
| - | * Firmware mit Python Interpreter: | ||
| - | * VS Code Extension: [[https:// | ||
| - | |||
| - | <code python main.py> | ||
| - | from helloWorld import hello_world | ||
| - | from led import set_pin, led, blinker | ||
| - | |||
| - | |||
| - | def main(): | ||
| - | hello_world() | ||
| - | set_pin(15) | ||
| - | led(True) | ||
| - | blinker() | ||
| - | |||
| - | |||
| - | if __name__ == ' | ||
| - | main() | ||
| - | |||
| - | </ | ||
| - | |||
| - | <code python helloWorld.py> | ||
| - | def hello_world(): | ||
| - | print(" | ||
| - | print(f" | ||
| - | |||
| - | </ | ||
| - | |||
| - | <code python led.py> | ||
| - | import time | ||
| - | |||
| - | from machine import Pin | ||
| - | |||
| - | global __PIN__ | ||
| - | |||
| - | |||
| - | def set_pin(pin): | ||
| - | global __PIN__ | ||
| - | __PIN__ = Pin(pin, Pin.OUT) | ||
| - | |||
| - | |||
| - | def led(on): | ||
| - | pin = __PIN__ | ||
| - | if on: | ||
| - | pin.on() | ||
| - | else: | ||
| - | pin.off() | ||
| - | |||
| - | |||
| - | def blinker(): | ||
| - | pin = __PIN__ | ||
| - | while True: | ||
| - | pin.on() | ||
| - | time.sleep(1) | ||
| - | pin.off() | ||
| - | time.sleep(1) | ||
| - | |||
| - | </ | ||
| - | |||
/home/http/wiki/data/attic/hardware/microcontroller_mcu.1677773588.txt · Zuletzt geändert: von manfred
