.

Dependencies:   L432KC_SPI_Pey_Lal

Files at this revision

API Documentation at this revision

Comitter:
voltxd
Date:
Mon May 23 17:18:33 2022 +0000
Parent:
117:58148bdd13b7
Commit message:
ajoutvitesse;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon May 23 13:05:26 2022 +0000
+++ b/main.cpp	Mon May 23 17:18:33 2022 +0000
@@ -158,6 +158,8 @@
     //Measure car speed
     double currentSpeedPeriod = tSpeed.read();
     currentSpeed = DISTANCE_FOR_HALF_TURN / currentSpeedPeriod;
+    if (pulsewidth_propulsion > 1500)
+        currentSpeed = -currentSpeed;
     tSpeed.reset();
 }