5108: add missing example

This commit is contained in:
occheung 2022-01-25 09:41:49 +08:00
parent ac198d0c52
commit 3570028b72
1 changed files with 21 additions and 0 deletions

21
examples/sampler.py Normal file
View File

@ -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)