   (let [serial-str (format "a=%.3f,b=%.3f,c=%.3f," base-angle first-angle second-angle)]
     (println (str "--> " serial-str))
     (.writeString *serial-conn* serial-str)
-    (let [echo (aget (.readBytes *serial-conn* 1) 0)]
+    (let [echo (char (aget (.readBytes *serial-conn* 1) 0))]
       (when-not (= echo \0) (println (str echo " angle out of range"))))
     (loop [reduce-str "<-- "
-           curr-char (aget (.readBytes *serial-conn* 1) 0)]
-      (if (= curr-char (byte \n))
+           curr-char (char (aget (.readBytes *serial-conn* 1) 0))]
+      (if (= curr-char \newline)
         (println reduce-str)
-        (recur (str reduce-str (char curr-char)) (aget (.readBytes *serial-conn* 1) 0))))))
+        (recur (str reduce-str curr-char) (char (aget (.readBytes *serial-conn* 1) 0)))))))
 
 (defn calc-angle-seq [input-str]
   (let [input (load-string input-str)

        (conj reslt-strokes (fill-gap (last last-stroke) (first (first left-strokes))))))))

(defn process-stroke [stroke scale default-z]
  (map (fn [[x y]] (list (- (* 15. (/ x scale)) 7.5) (+ (* 15. (/ (- scale y) scale)) 7.5) default-z)) stroke))

(defn dump-strokes [strokes title]
  (println (str title " >>>"))


(def PI Math/PI)

;; 
;; Write field is x (-10, 10) y (22, 32)
;;
(def min-y 22)
(def field-size 20)

(def first-arm 22.2)
(def second-arm 25.0)

(defn to-int [val]
  (int (+ 0.5 val)))
