From: daniel watson Date: Fri, 4 Dec 2015 23:37:46 +0000 (-0800) Subject: clarify lack of checking speed lower bound X-Git-Url: http://challenge-bot.com/repos/?p=challenge-bot;a=commitdiff_plain;h=d77c514c0f5c727a0ba0942fedc313c0daaf77f2 clarify lack of checking speed lower bound 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. --- diff --git a/build-stages/h_stay_on_table/h_stay_on_table.ino b/build-stages/h_stay_on_table/h_stay_on_table.ino index 58b55ab..48d0802 100644 --- a/build-stages/h_stay_on_table/h_stay_on_table.ino +++ b/build-stages/h_stay_on_table/h_stay_on_table.ino @@ -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);}