ceu-leds.rkt

This commit is contained in:
Tony Garnock-Jones 2017-10-20 16:25:16 +01:00
parent 45eee62fc2
commit fa82634868
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#lang syndicate
;; After [1], figure 1.
;;
;; [1] F. SantAnna, N. Rodriguez, R. Ierusalimschy, O. Landsiedel,
;; and P. Tsigas, “Safe system-level concurrency on
;; resource-constrained nodes,” Proc. 11th ACM Conf. Embed. Networked
;; Sens. Syst. - SenSys 13, vol. 13, pp. 114, 2013.
(require/activate syndicate/drivers/timestate)
(define (led-on) (printf "LED ON\n"))
(define (led-off) (printf "led off\n"))
;;---------------------------------------------------------------------------
(spawn (on-stop (led-off))
(on-start (let loop ()
(led-on)
(sleep 2)
(led-off)
(sleep 1)
(loop)))
(stop-when-timeout 10000)) ;; in the paper, it's 1 minute = 60000 milliseconds