kopia lustrzana https://github.com/micropython/micropython
examples: hwconfig_console: Add .on()/.off() methods.
Add these methods to this "GPIO output emulated with console prints" config.pull/3349/merge
rodzic
c15be989ee
commit
53966fd9a8
|
@ -8,6 +8,12 @@ class LEDClass:
|
|||
def value(self, v):
|
||||
print(self.id, v)
|
||||
|
||||
def on(self):
|
||||
self.value(1)
|
||||
|
||||
def off(self):
|
||||
self.value(0)
|
||||
|
||||
|
||||
LED = LEDClass(1)
|
||||
LED2 = LEDClass(12)
|
||||
|
|
Ładowanie…
Reference in New Issue