From 3549f25bb00853d1cb2d2e3d85ba091f601032ff Mon Sep 17 00:00:00 2001 From: Qnurye Date: Sun, 24 Dec 2023 18:37:59 +0800 Subject: [PATCH] final --- Arduino/lib/TB660/TB660.h | 2 +- Go/config/formula.json | 2 +- Go/main.go | 5 ++--- Go/tests/parser_test.go | 5 ++--- README.md | 1 + 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Arduino/lib/TB660/TB660.h b/Arduino/lib/TB660/TB660.h index 356d893..88da01c 100644 --- a/Arduino/lib/TB660/TB660.h +++ b/Arduino/lib/TB660/TB660.h @@ -4,7 +4,7 @@ #ifndef CUBER_TB660_H #define CUBER_TB660_H -#define DEFAULT_DUTY_CYCLE 90 +#define DEFAULT_DUTY_CYCLE 60 #include "Pin.h" diff --git a/Go/config/formula.json b/Go/config/formula.json index 961ada8..3377987 100644 --- a/Go/config/formula.json +++ b/Go/config/formula.json @@ -1,3 +1,3 @@ { - "formula": "U' F2 D2 R' B' D' F L' B2 D' U2 R2 D2 F D2 F R2 D2 B D2 F2" + "formula": "U2 F L' F2 B L2 U' D' L F U R U' F2 D' R2 U F2 R2 U2" } \ No newline at end of file diff --git a/Go/main.go b/Go/main.go index 573bd4b..598fdbf 100644 --- a/Go/main.go +++ b/Go/main.go @@ -16,7 +16,7 @@ func main() { if err != nil { log.Fatal(err) } - c := &serial.Config{Name: "/dev/ttyACM0", Baud: 9600} + c := &serial.Config{Name: "/dev/ttyACM1", Baud: 9600} s, err := serial.OpenPort(c) if err != nil { log.Fatal(err) @@ -42,10 +42,9 @@ func main() { _, _ = s.Read(buf) for len(buf) == 0 { } - d := time.Since(bTime) bTime = time.Now() - if d > 100*time.Millisecond { + if d > 300*time.Millisecond { step += 1 slept += d diff --git a/Go/tests/parser_test.go b/Go/tests/parser_test.go index 28aa87c..17afd07 100644 --- a/Go/tests/parser_test.go +++ b/Go/tests/parser_test.go @@ -3,7 +3,6 @@ package tests import ( "fmt" "log" - "os" "qnurye/Cuber/pkg/config" "qnurye/Cuber/pkg/rubiksCube" "strconv" @@ -26,8 +25,8 @@ func TestCubeParser_ParseFormula_Performance(t *testing.T) { parser := rubiksCube.NewCubeParser(cmdConfig, delayConfig) // 运行测试 - //formula := "F2 R2 L U F D' R2 B R' U L2 U B2 D' L2 U' R2 D2 B2 L2 D'" - formula, err := os.ReadFile("../config/mofang.txt") + formula := "U2 F L' F2 B L2 U' D' L F U R U' F2 D' R2 U F2 R2 U2" + //formula, err := os.ReadFile("../config/mofang.txt") commands, err := parser.ParseFormula(string(formula)) if err != nil { t.Fatalf("ParseFormula failed: %v", err) diff --git a/README.md b/README.md index 40ec714..86b283d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[简体中文](README.zh-CN.md) # Cuber