Skip to content

Commit

Permalink
final
Browse files Browse the repository at this point in the history
  • Loading branch information
Qnurye committed Dec 24, 2023
1 parent 7c6c564 commit 3549f25
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Arduino/lib/TB660/TB660.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion Go/config/formula.json
Original file line number Diff line number Diff line change
@@ -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"
}
5 changes: 2 additions & 3 deletions Go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down
5 changes: 2 additions & 3 deletions Go/tests/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package tests
import (
"fmt"
"log"
"os"
"qnurye/Cuber/pkg/config"
"qnurye/Cuber/pkg/rubiksCube"
"strconv"
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[简体中文](README.zh-CN.md)

# Cuber

Expand Down

0 comments on commit 3549f25

Please sign in to comment.