From 53966fd9a8c1b7d8a75e8d1c479c8219c8d101d3 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 9 Oct 2017 00:22:30 +0300 Subject: [PATCH] examples: hwconfig_console: Add .on()/.off() methods. Add these methods to this "GPIO output emulated with console prints" config. --- examples/hwapi/hwconfig_console.py | 6 ++++++ 1 file changed, 6 insertions(+) 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)