From 225d17bfb8a85d350ea8b43477690bdb725a2832 Mon Sep 17 00:00:00 2001 From: Alex <84599917+GyverLibs@users.noreply.github.com> Date: Sat, 18 Sep 2021 12:12:12 +0300 Subject: [PATCH] upd --- Planner Simulation/Planner2/planner_v4.pde | 7 +++++-- src/GyverPlanner2.h | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Planner Simulation/Planner2/planner_v4.pde b/Planner Simulation/Planner2/planner_v4.pde index dae625d..1d53620 100644 --- a/Planner Simulation/Planner2/planner_v4.pde +++ b/Planner Simulation/Planner2/planner_v4.pde @@ -110,7 +110,7 @@ class Planner_v4 { if (status > 1 && millis() - tmr >= us/1000) { tmr = millis(); tickManual(); - + // ВЫВОД МАРШРУТА int vel = us==0 ? 0 : 1000000/us; int hue = int(map(vel, 0, V, 0, 70)); @@ -220,7 +220,10 @@ class Planner_v4 { bufS.set(i, s1); if (bufL.get(i + 1) == 1) break; - + if (a == 0) { + bufV.set(i + 1, int(V)); + continue; + } if (i < bufV.available() - 2) { int multSum = 0; diff --git a/src/GyverPlanner2.h b/src/GyverPlanner2.h index 767d979..3681270 100644 --- a/src/GyverPlanner2.h +++ b/src/GyverPlanner2.h @@ -307,8 +307,12 @@ class GPlanner2 { } uint32_t s1 = sqrt(sqSum); bufS.set(i, s1); - if (s1 == 0) continue; if (bufL.get(i + 1) == 1) break; + if (a == 0) { + bufV.set(i + 1, uint16_t(V)); + continue; + } + if (s1 == 0) continue; if (i < bufV.available() - 2) { int32_t multSum = 0;