Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Commit 53966fd

Browse files
author
Paul Sokolovsky
committed
examples: hwconfig_console: Add .on()/.off() methods.
Add these methods to this "GPIO output emulated with console prints" config.
1 parent c15be98 commit 53966fd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

examples/hwapi/hwconfig_console.py

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ def __init__(self, id):
88
def value(self, v):
99
print(self.id, v)
1010

11+
def on(self):
12+
self.value(1)
13+
14+
def off(self):
15+
self.value(0)
16+
1117

1218
LED = LEDClass(1)
1319
LED2 = LEDClass(12)

0 commit comments

Comments
 (0)