Skip to content

Instantly share code, notes, and snippets.

Created January 2, 2013 03:01
Show Gist options
  • Save anonymous/4431787 to your computer and use it in GitHub Desktop.
Save anonymous/4431787 to your computer and use it in GitHub Desktop.
Clojure AR Drone Baby Steps
(ns clj-drone.core
(:import (java.net DatagramPacket DatagramSocket InetAddress)))
(def drone-host (InetAddress/getByName "192.168.1.1"))
(def at-port 5556)
(def socket (DatagramSocket. ))
(defn send-command [data]
(.send socket
(new DatagramPacket (.getBytes data) (.length data) drone-host at-port)))
(def take-off "AT*REF=1,290718208\r")
(def land "AT*REF=2,290717696\r")
(send-command take-off)
(send-command land)
@gigasquid
Copy link

Nice - a bit windy though :)

I was so excited I forgot to sign in before posting - I moved it to here https://gist.github.com/4431845

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment