diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-11-18 07:20:26 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-11-18 07:20:26 +0300 |
commit | 00d6f99cf1f94babb237bff00364497ec30f475c (patch) | |
tree | 88291cd95e70430e22f61623a99a108dccd85c8f /examples/hwapi | |
parent | e81a5353cb794b8d6c57317488e5db6a1c524755 (diff) | |
download | micropython-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.py | 13 |
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) |