clarify lack of checking speed lower bound
authordaniel watson <ozzloy@gmail.com>
Fri, 4 Dec 2015 23:37:46 +0000 (15:37 -0800)
committerdaniel watson <ozzloy@gmail.com>
Fri, 4 Dec 2015 23:37:46 +0000 (15:37 -0800)
speed is guaranteed to be non-negative by this point in the code, so
there's no need to test if it's too negative.

build-stages/h_stay_on_table/h_stay_on_table.ino

index 58b55ab7aa2a71717df68642c655b015eac10055..48d0802d8c92643054b13e0977916078487ca58c 100644 (file)
@@ -48,6 +48,7 @@ void set_motor(int speed_pin,
   else{ // speed is 0
     off(forward_pin);
     off(backward_pin);}
+  // since speed has been set positive, no need to check if speed < -255.
   if(speed > 255){
     speed = 255;}
   analogWrite(speed_pin, speed);}