diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-10-09 00:22:30 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-10-09 00:22:30 +0300 |
commit | 53966fd9a8c1b7d8a75e8d1c479c8219c8d101d3 (patch) | |
tree | 98d3b4184382599726538ed815e0a1a250488a55 /examples/hwapi/hwconfig_console.py | |
parent | c15be989ee195d375f93b39aa13bc4e07b36c1eb (diff) |
examples: hwconfig_console: Add .on()/.off() methods.
Add these methods to this "GPIO output emulated with console prints"
config.
Diffstat (limited to 'examples/hwapi/hwconfig_console.py')
-rw-r--r-- | examples/hwapi/hwconfig_console.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/hwapi/hwconfig_console.py b/examples/hwapi/hwconfig_console.py index 4b0b0d79b..bbcc0e816 100644 --- a/examples/hwapi/hwconfig_console.py +++ b/examples/hwapi/hwconfig_console.py @@ -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) |