====== MicroPython : Libraries ====== [[http://www.openhardsoftware.de/ | Open Hard- & Software]] [ [[http://www.openhardsoftware.de/dokuwiki | DokuWiki]] [[http://www.openhardsoftware.de/websites | WebSites]] [[http://www.openhardsoftware.de/mediawiki | MediaWiki]] [[http://www.openhardsoftware.de/nextcloud | NextCloud]] ] ===== Esp32CheckMath ===== Library **Math** mit Funktionen **Add** und **Sub** **Math.py** # def Add(a, b): return a + b # def Sub(a, b): return a - b # **Esp32CheckMath.py** # import Math as MAT # print('3 + 5 = {}'.format(MAT.Add(3, 5))) Download: {{ :micropython:2112062054_esp32checkmath_01v01.zip |Esp32CheckMath 01v01}} ===== Esp32CheckLedSystem ===== **LedSystem.py** # 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); **Esp32CheckLedSystem.py** # import time # import LedSystem as LS # LedSystem = LS.CLedSystem(2) LedSystem.Open() for I in range(0, 100): LedSystem.On() time.sleep_ms(100) LedSystem.Off() time.sleep_ms(100) LedSystem.Close() Download: {{ :micropython:2112062056_esp32checkledsystem_01v01.zip |Esp32CheckLedSystem 01V01}} ----- [[http://www.openhardsoftware.de/ | Open Hard- & Software]] [ [[http://www.openhardsoftware.de/dokuwiki | DokuWiki]] [[http://www.openhardsoftware.de/websites | WebSites]] [[http://www.openhardsoftware.de/mediawiki | MediaWiki]] [[http://www.openhardsoftware.de/nextcloud | NextCloud]] ]