diff --git a/.github/workflows/makecode.yml b/.github/workflows/makecode.yml index 17c9b602..6c12c44d 100644 --- a/.github/workflows/makecode.yml +++ b/.github/workflows/makecode.yml @@ -39,3 +39,5 @@ jobs: run: | cd robot makecode + makecode -c mkc-cutebot.json + makecode -c mkc-yahboomtinybit.json diff --git a/robot/main.ts b/robot/main.ts deleted file mode 100644 index 9be22391..00000000 --- a/robot/main.ts +++ /dev/null @@ -1,18 +0,0 @@ - -//const robotDriver = microcode.elecfreaksCuteBot -const robotDriver = microcode.dfRobotMicroMaqueen - -basic.forever(() => { - const dist = robotDriver.ultrasonicDistance() - if (dist > 10) - robotDriver.motorRun(100) - else { - robotDriver.motorStop() - robotDriver.motorRun(-50) - pause(400) - robotDriver.motorStop() - robotDriver.motorTurn(50) - pause(400) - robotDriver.motorStop() - } -}) \ No newline at end of file diff --git a/robot/maincutebot.ts b/robot/maincutebot.ts new file mode 100644 index 00000000..62171525 --- /dev/null +++ b/robot/maincutebot.ts @@ -0,0 +1 @@ +microcode.elecfreaksCuteBot.start() diff --git a/robot/mainyahboomtinybit.ts b/robot/mainyahboomtinybit.ts new file mode 100644 index 00000000..f318b2a4 --- /dev/null +++ b/robot/mainyahboomtinybit.ts @@ -0,0 +1 @@ +microcode.yahboomTinyBit.start() diff --git a/robot/mkc-cutebot.json b/robot/mkc-cutebot.json new file mode 100644 index 00000000..0f3a1b3d --- /dev/null +++ b/robot/mkc-cutebot.json @@ -0,0 +1,5 @@ +{ + "overrides": { + "testFiles": ["maincutebot.ts"] + } +} diff --git a/robot/mkc-yahboomtinybit.json b/robot/mkc-yahboomtinybit.json new file mode 100644 index 00000000..c69c0162 --- /dev/null +++ b/robot/mkc-yahboomtinybit.json @@ -0,0 +1,5 @@ +{ + "overrides": { + "testFiles": ["mainyahboomtinybit.ts"] + } +} diff --git a/robot/test.ts b/robot/test.ts index e40f282e..61b06910 100644 --- a/robot/test.ts +++ b/robot/test.ts @@ -3,25 +3,16 @@ microcode.elecfreaksCuteBot.start() //microcode.keyStudioMiniSmartRobot.start() microcode.setMotorDrift(6) -const robotDriver = microcode.robotDriver -robotDriver.motorRun(60) -/* basic.forever(() => { - robotDriver.motorRun(100) - pause(1500) - robotDriver.motorRun(-100) - pause(1500) -}) -*/ -/* - - const dist = robotDriver.ultrasonicDistance() - if (dist > 5) - robotDriver.motorRun(100) + const dist = microcode.robotDriver.ultrasonicDistance() + if (dist > 10) microcode.robotDriver.motorRun(100) else { - robotDriver.motorRun(-50) + microcode.robotDriver.motorStop() + microcode.robotDriver.motorRun(-50) pause(400) - robotDriver.motorTurn(50) - pause(800) + microcode.robotDriver.motorStop() + microcode.robotDriver.motorTurn(50) + pause(400) + microcode.robotDriver.motorStop() } - */ +})