forked from M-Labs/artiq
1
0
Fork 0

examples/blink_forever: port to NAC3

This commit is contained in:
Sebastien Bourdeauducq 2021-11-10 13:59:59 +08:00
parent 2f031285a4
commit 262cd62544
1 changed files with 8 additions and 3 deletions

View File

@ -1,7 +1,12 @@
from artiq.experiment import * from artiq.experiment import *
from artiq.coredevice.core import Core
from artiq.coredevice.ttl import TTLOut
@nac3
class BlinkForever(EnvExperiment): class BlinkForever(EnvExperiment):
core: KernelInvariant[Core]
led: KernelInvariant[TTLOut]
def build(self): def build(self):
self.setattr_device("core") self.setattr_device("core")
self.setattr_device("led") self.setattr_device("led")
@ -10,5 +15,5 @@ class BlinkForever(EnvExperiment):
def run(self): def run(self):
self.core.reset() self.core.reset()
while True: while True:
self.led.pulse(100*ms) self.led.pulse(100.*ms)
delay(100*ms) self.core.delay(100.*ms)