examples: hwconfig_console: Add .on()/.off() methods.

Add these methods to this "GPIO output emulated with console prints"
config.
pull/1/head
Paul Sokolovsky 2017-10-09 00:22:30 +03:00
parent c15be989ee
commit 53966fd9a8
1 changed files with 6 additions and 0 deletions

View File

@ -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)