Skip to content

Commit

Permalink
更新 pxt.json, main.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
elecfreaks1 committed Aug 5, 2023
1 parent da074e6 commit a40bd2c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
29 changes: 16 additions & 13 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1082,29 +1082,31 @@ namespace CutebotPro {
let orientation = 0
let cmd = 0
CutebotPro.pwmCruiseControl(0, 0)
if (turn == CutebotProTurn.Left){
basic.pause(1000)

if (angle == CutebotProAngle.Angle45)
tempangle = 150
else if (angle == CutebotProAngle.Angle90)
tempangle = 316
else if (angle == CutebotProAngle.Angle135)
tempangle = 450
else
tempangle = 630

if (turn == CutebotProTurn.Left) {
orientation = CutebotProWheel.RightWheel
cmd = 0x04
}
else if (turn == CutebotProTurn.Right){
else if (turn == CutebotProTurn.Right) {
orientation = CutebotProWheel.LeftWheel
cmd = 0x04
}
else{
else {
orientation = CutebotProWheel.AllWheel
cmd = 23
tempangle = tempangle + 5
}

if (angle == CutebotProAngle.Angle45)
tempangle = 148
else if (angle == CutebotProAngle.Angle90)
tempangle = 296
else if (angle == CutebotProAngle.Angle135)
tempangle = 442
else
tempangle = 630


buf[0] = 0x99;
buf[1] = cmd;
buf[2] = orientation;
Expand All @@ -1127,6 +1129,7 @@ namespace CutebotPro {
}

}
basic.pause(1000)
/*let D_Value = 0
let I_Value = 0
let P_Value = 0
Expand Down
3 changes: 2 additions & 1 deletion pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "ELECFREAKS cutebotpro car",
"license": "MIT",
"dependencies": {
"core": "*"
"core": "*",
"neopixel": "github:elecfreaks/pxt-neopixel"
},
"files": [
"README.md",
Expand Down

0 comments on commit a40bd2c

Please sign in to comment.