Skip to content

Instantly share code, notes, and snippets.

@ardumont
Created June 5, 2012 21:26
Show Gist options
  • Save ardumont/2878116 to your computer and use it in GitHub Desktop.
Save ardumont/2878116 to your computer and use it in GitHub Desktop.
launch the hello world from the repl
(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