aboutsummaryrefslogtreecommitdiff
path: root/robo.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-15 02:57:59 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-15 02:57:59 +0200
commit3a6d0889d1e811959558051362e8bf9cbfce1aa1 (patch)
tree644ce97b67765aed21b93cd5bd64707a8edcde2f /robo.go
parent475adb8320004379d947cd5a20157e9abe444299 (diff)
More functions
Diffstat (limited to 'robo.go')
-rw-r--r--robo.go28
1 files changed, 23 insertions, 5 deletions
diff --git a/robo.go b/robo.go
index 57bc6b7..57a45a2 100644
--- a/robo.go
+++ b/robo.go
@@ -119,8 +119,26 @@ func point(c *bufio.ReadWriter, cmd string) Point {
return NewPoint(recv(c.Reader))
}
-func Calibration(c *bufio.ReadWriter) Point { return point(c, "TB71") }
-func Offset(c *bufio.ReadWriter) Point { return point(c, "?") }
-func LowerLeft(c *bufio.ReadWriter) Point { return point(c, "[") }
-func UpperRight(c *bufio.ReadWriter) Point { return point(c, "U") }
-func StatusWord(c *bufio.ReadWriter) Point { return point(c, "@") }
+func Calibration(c *bufio.ReadWriter) Point { return point(c, "TB71") }
+func Offset(c *bufio.ReadWriter) Point { return point(c, "?") }
+func LowerLeft(c *bufio.ReadWriter) Point { return point(c, "[") }
+func UpperRight(c *bufio.ReadWriter) Point { return point(c, "U") }
+func StatusWord(c *bufio.ReadWriter) Point { return point(c, "@") }
+func DistanceCorrection(c *bufio.ReadWriter) Point { return point(c, "FA") }
+
+func (o Orientation) Orientation(c *bufio.Writer) { send(c, "FN", o) }
+
+func triple(c *bufio.ReadWriter, cmd string) Triple {
+ send(c.Writer, cmd)
+ return NewTriple(recv(c.Reader))
+}
+
+func Gin(c *bufio.ReadWriter) Triple { return triple(c, "G") }
+func CallGin(c *bufio.ReadWriter) Triple { return triple(c, "C") }
+
+func (t Triple) send(c *bufio.Writer, cmd string) {
+ fmt.Fprint(c, cmd, t)
+ etx(c)
+}
+
+func (t Triple) Factor(c *bufio.Writer) { t.send(c, "&") }