Created
June 5, 2012 21:26
-
-
Save ardumont/2878116 to your computer and use it in GitHub Desktop.
launch the hello world from the repl
This file contains hidden or 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
(def device-board "/dev/ttyACM0") | |
;; this is a limitation on the underlying lib clodiuno uses. Indeed, it searches only for /dev/ttySxx serial devices | |
;; and on ubuntu GNU/Linux it's named /dev/ACM0 | |
(System/setProperty "gnu.io.rxtx.SerialPorts" device-board) | |
;; now declaring the board | |
(def board (arduino :firmata device-board)) | |
;; the led must be set in output mode | |
(pin-mode board pin-led OUTPUT) | |
;; Now the heart of the program | |
(write-morse board "hello world") | |
;; just to show you that it works (as almost everybody knows at least that sos is 3 short 3 long 3 short) | |
(write-morse board "sos") | |
;; do not forget to free the board | |
(close board) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment