.
Dependencies: L432KC_SPI_Pey_Lal
Diff: main.cpp
- Revision:
- 118:67d6698069fd
- Parent:
- 117:58148bdd13b7
diff -r 58148bdd13b7 -r 67d6698069fd main.cpp --- 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(); }