Fix parking sensor bug found by Dan S.
This commit is contained in:
@@ -137,7 +137,7 @@ void loop() {
|
|||||||
numLightPixels--;
|
numLightPixels--;
|
||||||
} else {
|
} else {
|
||||||
skipZero = 0;
|
skipZero = 0;
|
||||||
int newLightPixels = NUMPIXELS - (NUMPIXELS*(displayDist-PANIC_DISTANCE)/MAX_DISTANCE);
|
int newLightPixels = NUMPIXELS - (NUMPIXELS*(displayDist-PANIC_DISTANCE)/(MAX_DISTANCE-PANIC_DISTANCE));
|
||||||
if (newLightPixels>numLightPixels) {
|
if (newLightPixels>numLightPixels) {
|
||||||
// Fast raise
|
// Fast raise
|
||||||
numLightPixels += max((newLightPixels - numLightPixels) / 2, 1);
|
numLightPixels += max((newLightPixels - numLightPixels) / 2, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user