User Tools

Site Tools


module:micropython:esp32checkledsystem

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
module:micropython:esp32checkledsystem [2021/12/08 12:10] – [Benutzung] omdevelopmodule:micropython:esp32checkledsystem [2022/09/13 11:58] (current) – external edit 127.0.0.1
Line 11: Line 11:
 Beispiel für die Einbindung der MicroPython-Library **LedSystem.py** : Beispiel für die Einbindung der MicroPython-Library **LedSystem.py** :
 <code python> <code python>
 +#
 +from machine import Pin
 +#
 +class CLedSystem():
 +  #
 +  def __init__(self, pinindex):
 +    self.PinIndex = pinindex
 +    return
 +  #
 +  def Open(self):
 +    self.Pin = Pin(self.PinIndex, Pin.OUT)
 +    return 
 +  def Close(self):
 +    self.Pin = Pin(self.PinIndex, Pin.IN)
 +    return 
 +  #
 +  def On(self):
 +    self.Pin.value(1)
 +  #
 +  def Off(self):
 +    self.Pin.value(0);
 </code> </code>
 Wichtig: Die Library **LedSystem.py** muss im FileSystem des MicroControllers vorhanden sein! Wichtig: Die Library **LedSystem.py** muss im FileSystem des MicroControllers vorhanden sein!
Line 31: Line 52:
 </code> </code>
  
-Run-Ausgabe im Terminal:+Run-Ausgabe im Terminal, Programm-Ende nach 100-fachen Blinken der LedSystem:
 <code> <code>
->>> Running ..\Esp32CheckMath.py +>>> Running ..\Esp32CheckLedSystem.py 
->>>  +>>>
-3 + 5 = 8 +
-3 - 5 = -2+
 ♦♦> ♦♦>
 MicroPython v1.17 on 2021-09-02; ESP32 module with ESP32 MicroPython v1.17 on 2021-09-02; ESP32 module with ESP32
Line 45: Line 64:
 ===== Version ===== ===== Version =====
  
-{{:module:micropython:2112081148_esp32checkmath_01v02.zip | 2112081148_Esp32CheckMath_01v02.zip}} \\ +{{:module:micropython:2112062056_Esp32CheckLedSystem_01v01.zip | 2112062056_Esp32CheckLedSystem_01v01.zip}}
-{{:module:micropython:2112062054_esp32checkmath_01v01.zip | 2112062054_Esp32CheckMath_01v01.zip}}+
  
 ===== ===== ===== =====
module/micropython/esp32checkledsystem.1638961858.txt.gz · Last modified: 2021/12/08 13:10 (external edit)