Created
January 2, 2013 03:01
-
-
Save anonymous/4431787 to your computer and use it in GitHub Desktop.
Clojure AR Drone Baby Steps
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
(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) |
gfredericks
commented
Jan 2, 2013
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