            (GET "/set-angle" [a b c] (if (and a b c)
                                        (set-angle a b c)
                                        "/set-angle?a=<base>&b=<large>&c=<small>"))
-           ;(POST "/write-character" [strokes] (write-strokes (calc-angle-seq strokes)))
-           (POST "/write-character" req (println req))
+           (POST "/write-character" [strokes] (write-strokes (calc-angle-seq strokes)))
            (resources "/")
            (not-found "<h1>not found</h1>"))
 

(def ^:dynamic *serial-conn*)

(defn set-angle [base-angle first-angle second-angle]
  (println (str "--> " "a=" base-angle ",b=" first-angle ",c=" second-angle ","))
  (.writeString *serial-conn* (str "a=" base-angle ",b=" first-angle ",c=" second-angle ","))
  (.readBytes *serial-conn* 1)
  (loop [reduce-str "<-- "
         curr-char (aget (.readBytes *serial-conn* 1) 0)]
    (if (= curr-char (byte \n))
      (println reduce-str)
      (recur (str reduce-str (char curr-char)) (aget (.readBytes *serial-conn* 1) 0)))))

(defn calc-angle-seq [input-str]
  (let [input (load-string input-str)

        alpha-beta-radian-list (map #(calc-alpha-beta (first %1) %2) r-theta-list (map (fn [x] (last x)) strokes-z))
        alpha-beta-degree-list (map (fn [[alpha beta]] (list (radian-to-degree alpha) (radian-to-degree beta))) alpha-beta-radian-list)]
    (println input-str)
    (map (fn [[_ theta] [alpha beta]] (list theta beta (- 180 alpha beta))) r-theta-list alpha-beta-degree-list)))

(defn write-strokes [angles-seq]
  (doseq [[base-angle first-angle second-angle] angles-seq]
    (set-angle base-angle first-angle second-angle))
  "OK")

(defroutes app
