| 1 | import logging |
| 2 | import time |
| 3 | |
| 4 | from labgrid import Environment |
| 5 | from labgrid.logging import basicConfig, StepLogger |
| 6 | |
| 7 | # enable info logging |
| 8 | basicConfig(level=logging.INFO) |
| 9 | |
| 10 | # show labgrid steps on the console |
| 11 | StepLogger.start() |
| 12 | |
| 13 | e = Environment("import-gpio.yaml") |
| 14 | t = e.get_target() |
| 15 | |
| 16 | p = t.get_driver("DigitalOutputProtocol") |
| 17 | print(t.resources) |
| 18 | p.set(True) |
| 19 | print(p.get()) |
| 20 | time.sleep(2) |
| 21 | p.set(False) |
| 22 | print(p.get()) |
| 23 | time.sleep(2) |
| 24 | p.set(True) |
| 25 | print(p.get()) |