summaryrefslogtreecommitdiffstatshomepage
path: root/examples/hwapi
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-11-18 07:20:26 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-11-18 07:20:26 +0300
commit00d6f99cf1f94babb237bff00364497ec30f475c (patch)
tree88291cd95e70430e22f61623a99a108dccd85c8f /examples/hwapi
parente81a5353cb794b8d6c57317488e5db6a1c524755 (diff)
downloadmicropython-00d6f99cf1f94babb237bff00364497ec30f475c.tar.gz
micropython-00d6f99cf1f94babb237bff00364497ec30f475c.zip
examples/hwapi: Add hwconfig for console tracing of LED operations.
Diffstat (limited to 'examples/hwapi')
-rw-r--r--examples/hwapi/hwconfig_console.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/hwapi/hwconfig_console.py b/examples/hwapi/hwconfig_console.py
new file mode 100644
index 0000000000..7355571a10
--- /dev/null
+++ b/examples/hwapi/hwconfig_console.py
@@ -0,0 +1,13 @@
+# This is hwconfig for "emulation" for cases when there's no real hardware.
+# It just prints information to console.
+class LEDClass:
+
+ def __init__(self, id):
+ self.id = id
+
+ def value(self, v):
+ print("LED(%d):" % self.id, v)
+
+
+LED = LEDClass(1)
+LED2 = LEDClass(12)