aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--easteregg.go8
-rw-r--r--main.go8
-rw-r--r--marks.go42
3 files changed, 55 insertions, 3 deletions
diff --git a/easteregg.go b/easteregg.go
index e9afa9d..232ca40 100644
--- a/easteregg.go
+++ b/easteregg.go
@@ -302,8 +302,12 @@ var easteregg = []string{
}
func (c Cutter) EasterEgg() {
- for _, l := range easteregg {
- fmt.Fprint(c, l)
+ c.Raw(easteregg)
+}
+
+func (c Cutter) Raw(s []string) {
+ for _, cmd := range s {
+ fmt.Fprint(c, cmd)
c.Emit()
c.Wait()
}
diff --git a/main.go b/main.go
index cb97dff..2d2f196 100644
--- a/main.go
+++ b/main.go
@@ -9,6 +9,8 @@ func main() {
cu := NewCutter(dev.Handle())
p := pens["pen"]
+ cu.Initialize()
+
v, _ := cu.Version()
fmt.Println("Craft ROBO Ver.", v)
@@ -20,9 +22,13 @@ func main() {
defer cu.Home()
defer cu.LineType(Solid)
- cu.TestCut()
+ //cu.TestCut()
//cu.TestPattern()
//cu.EasterEgg()
+ //cu.DrawMarks()
+ cu.Move(Point{300, 300})
+ cu.SearchMarks()
+ //cu.Bezier(1, Point{0,0},Point{0,1000},Point{0,0},Point{1000,0})
/*
for i := 0; i < 9; i++ {
diff --git a/marks.go b/marks.go
new file mode 100644
index 0000000..8a37b4d
--- /dev/null
+++ b/marks.go
@@ -0,0 +1,42 @@
+package main
+
+/*
+ Marks
+ +-- --+
+ | |
+
+
+
+ |
+ +--
+
+ Offset: 10mm (200 pt)
+ Length: 20mm (400 pt)
+ Width: 190mm (3800 pt)
+ Height: 262mm (5240 pt)
+*/
+
+// 5440 x 4000
+// Origin: 200x200
+
+func (c Cutter) DrawMarks() (string, error) {
+ c.Move(Point{600, 3800})
+ c.Draw(Point{200, 3800})
+ c.Draw(Point{200, 3400})
+
+ c.Move(Point{200, 600})
+ c.Draw(Point{200, 200})
+ c.Draw(Point{600, 200})
+
+ c.Move(Point{4840, 200})
+ c.Draw(Point{5240, 200})
+ c.Draw(Point{5240, 600})
+
+ return c.readResponse()
+}
+
+func (c Cutter) SearchMarks() {
+ //cmd := []string{"TB99", "TB55,1", "TB123,3800,5240"}
+ cmd := []string{"TB99", "TB55,1", "TB23,3800,5240"}
+ c.Raw(cmd)
+}