examples: hwconfig_console: Add .on()/.off() methods.
Add these methods to this "GPIO output emulated with console prints" config.
This commit is contained in:
parent
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user