mirror of https://github.com/m-labs/artiq.git
examples: add kasli_drtioswitching
This commit is contained in:
parent
41972d6773
commit
8227037a84
|
@ -0,0 +1,34 @@
|
|||
core_addr = "kasli-1.lab.m-labs.hk"
|
||||
|
||||
device_db = {
|
||||
"core": {
|
||||
"type": "local",
|
||||
"module": "artiq.coredevice.core",
|
||||
"class": "Core",
|
||||
"arguments": {"host": core_addr, "ref_period": 1/(8*150e6)}
|
||||
},
|
||||
"core_log": {
|
||||
"type": "controller",
|
||||
"host": "::1",
|
||||
"port": 1068,
|
||||
"command": "aqctl_corelog -p {port} --bind {bind} " + core_addr
|
||||
},
|
||||
"core_cache": {
|
||||
"type": "local",
|
||||
"module": "artiq.coredevice.cache",
|
||||
"class": "CoreCache"
|
||||
},
|
||||
"core_dma": {
|
||||
"type": "local",
|
||||
"module": "artiq.coredevice.dma",
|
||||
"class": "CoreDMA"
|
||||
},
|
||||
}
|
||||
|
||||
for i in range(3):
|
||||
device_db["led" + str(i)] = {
|
||||
"type": "local",
|
||||
"module": "artiq.coredevice.ttl",
|
||||
"class": "TTLOut",
|
||||
"arguments": {"channel": i << 16},
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
from artiq.experiment import *
|
||||
|
||||
|
||||
class Blink(EnvExperiment):
|
||||
def build(self):
|
||||
self.setattr_device("core")
|
||||
self.leds = [self.get_device("led0"), self.get_device("led2")]
|
||||
|
||||
@kernel
|
||||
def run(self):
|
||||
while True:
|
||||
self.core.reset()
|
||||
|
||||
while True:
|
||||
for led in self.leds:
|
||||
led.pulse(200*ms)
|
||||
delay(200*ms)
|
Loading…
Reference in New Issue