From 3570028b724b7fec75450a22d1aa9d0c7a7e763d Mon Sep 17 00:00:00 2001 From: occheung Date: Tue, 25 Jan 2022 09:41:49 +0800 Subject: [PATCH] 5108: add missing example --- examples/sampler.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 examples/sampler.py diff --git a/examples/sampler.py b/examples/sampler.py new file mode 100644 index 0000000..c0b5dd8 --- /dev/null +++ b/examples/sampler.py @@ -0,0 +1,21 @@ +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)