sinarads/examples/sampler.py

22 lines
501 B
Python
Raw Normal View History

2022-01-25 09:41:49 +08:00
from artiq.experiment import *
class SamplerInit(EnvExperiment):
def build(self):
self.setattr_device("core")
self.sampler = self.get_device("sampler0")
def prepare(self):
self.smp = [0.0]*8
@kernel
def run(self):
self.core.reset()
self.core.break_realtime()
self.sampler.init()
delay(5*ms)
for i in range(8):
self.sampler.set_gain_mu(i, 0)
delay(100*us)
self.sampler.sample(self.smp)