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