Skip to content

Commit

Permalink
Обновить chassis.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
THEb0nny committed May 20, 2024
1 parent 53af9ee commit 3567037
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions chassis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace chassis {
*/
//% blockId="LinearDistMove"
//% block="linear distance moving $dist mm at $speed\\% braking $braking"
//% block.loc.ru="линейное движение на расстояние $dist мм на $speed\\% торможение $braking"
//% block.loc.ru="линейное движение на расстояние $dist мм с $speed\\% торможение $braking"
//% inlineInputMode="inline"
//% speed.shadow="motorSpeedPicker"
//% weight="79" blockGap="8"
Expand Down Expand Up @@ -42,7 +42,7 @@ namespace chassis {
*/
//% blockId="DistMove"
//% block="distance moving $dist mm at $speedLeft\\% $speedRight\\% braking $braking"
//% block.loc.ru="движение на расстояние $dist мм на $speedLeft\\% $speedRight\\% торможение $braking"
//% block.loc.ru="движение на расстояние $dist мм с $speedLeft\\% $speedRight\\% торможение $braking"
//% inlineInputMode="inline"
//% speedLeft.shadow="motorSpeedPicker"
//% speedRight.shadow="motorSpeedPicker"
Expand Down Expand Up @@ -86,8 +86,6 @@ namespace chassis {
export function RampLinearDistMove(minSpeed: number, maxSpeed: number, totalDist: number, accelDist: number, decelDist: number) {
if (maxSpeed == 0 || Math.abs(minSpeed) >= Math.abs(maxSpeed) || (minSpeed < 0 && maxSpeed > 0) || (minSpeed > 0 && maxSpeed < 0) || totalDist <= 0 || accelDist < 0 || decelDist < 0) {
chassis.stop(true);
music.playSoundEffect(sounds.systemGeneralAlert);
pause(2000);
return;
}
const mRotAccelCalc = Math.abs((accelDist / (Math.PI * chassis.getWheelRadius())) * 360); // Расчитываем расстояние ускорения
Expand Down Expand Up @@ -116,8 +114,6 @@ namespace chassis {
//if (!motorsPair) return;
if (maxSpeed == 0 || totalDist == 0) {
stop(true);
music.playSoundEffect(sounds.systemGeneralAlert);
pause(2000);
return;
}
const emlPrev = leftMotor.angle(); // Перед запуском мы считываем значение с энкодера на левом двигателе
Expand Down

0 comments on commit 3567037

Please sign in to comment.