Created
August 4, 2017 02:17
-
-
Save fsmunoz/424b052e1848cdda3bee043386bdc7bd to your computer and use it in GitHub Desktop.
Arduino LED blink with uLisp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Arduino LED blink | |
;; | |
;; Based on the example at http://www.ulisp.com/show?1LG8 | |
;; | |
;; 2017, Frederico Munoz <[email protected]> | |
(defun b (x s d) | |
"Slowly increases and decreases the blinking interval in a loop" | |
(pinmode 13 t) | |
(digitalwrite 13 x) | |
(delay s) | |
(cond | |
((< s 100) (b (not x) (+ s 50) 50)) | |
((> s 1000) (b (not x) (- s 50) -50)) | |
(t (b (not x) (+ s d) d)))) | |
(b t 500 50) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment