Skip to content

Instantly share code, notes, and snippets.

@gigasquid
Created January 2, 2013 03:18
Show Gist options
  • Save gigasquid/4431845 to your computer and use it in GitHub Desktop.
Save gigasquid/4431845 to your computer and use it in GitHub Desktop.
Baby Steps Clojure AR Drone
(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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment