From 592663a649e6210e2d99d0c5533a7bffb7e87098 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 31 Oct 2015 23:17:29 +0800 Subject: [PATCH] add "blink forever" example This is useful for quickly demonstrating the idle kernel. --- examples/master/repository/blink_forever.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 examples/master/repository/blink_forever.py diff --git a/examples/master/repository/blink_forever.py b/examples/master/repository/blink_forever.py new file mode 100644 index 000000000..9abd3968f --- /dev/null +++ b/examples/master/repository/blink_forever.py @@ -0,0 +1,13 @@ +from artiq import * + + +class BlinkForever(EnvExperiment): + def build(self): + self.setattr_device("core") + self.setattr_device("led") + + @kernel + def run(self): + while True: + self.led.pulse(100*ms) + delay(100*ms)