mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-20 08:56:28 +08:00
drtio: better LED demo
This commit is contained in:
parent
d547c5d922
commit
60e748eabe
@ -32,7 +32,42 @@
|
||||
"module": "artiq.coredevice.ttl",
|
||||
"class": "TTLOut",
|
||||
"arguments": {"channel": 1},
|
||||
"comment": "Hello World"
|
||||
},
|
||||
"rled2": {
|
||||
"type": "local",
|
||||
"module": "artiq.coredevice.ttl",
|
||||
"class": "TTLOut",
|
||||
"arguments": {"channel": 2},
|
||||
},
|
||||
"rled3": {
|
||||
"type": "local",
|
||||
"module": "artiq.coredevice.ttl",
|
||||
"class": "TTLOut",
|
||||
"arguments": {"channel": 3},
|
||||
},
|
||||
"rled4": {
|
||||
"type": "local",
|
||||
"module": "artiq.coredevice.ttl",
|
||||
"class": "TTLOut",
|
||||
"arguments": {"channel": 4},
|
||||
},
|
||||
"rled5": {
|
||||
"type": "local",
|
||||
"module": "artiq.coredevice.ttl",
|
||||
"class": "TTLOut",
|
||||
"arguments": {"channel": 5},
|
||||
},
|
||||
"rled6": {
|
||||
"type": "local",
|
||||
"module": "artiq.coredevice.ttl",
|
||||
"class": "TTLOut",
|
||||
"arguments": {"channel": 6},
|
||||
},
|
||||
"rled7": {
|
||||
"type": "local",
|
||||
"module": "artiq.coredevice.ttl",
|
||||
"class": "TTLOut",
|
||||
"arguments": {"channel": 7},
|
||||
},
|
||||
|
||||
"rsmap": {
|
||||
|
@ -4,11 +4,18 @@ from artiq.experiment import *
|
||||
class BlinkForever(EnvExperiment):
|
||||
def build(self):
|
||||
self.setattr_device("core")
|
||||
self.setattr_device("rled0")
|
||||
self.leds = [self.get_device("rled" + str(i)) for i in range(8)]
|
||||
|
||||
@kernel
|
||||
def run(self):
|
||||
self.core.reset()
|
||||
#self.core.reset()
|
||||
self.core.break_realtime()
|
||||
|
||||
while True:
|
||||
self.rled0.pulse(100*ms)
|
||||
delay(100*ms)
|
||||
for led in self.leds:
|
||||
led.pulse(250*ms)
|
||||
t = now_mu()
|
||||
for led in self.leds:
|
||||
at_mu(t)
|
||||
led.pulse(500*ms)
|
||||
delay(250*ms)
|
||||
|
Loading…
Reference in New Issue
Block a user