From d77c514c0f5c727a0ba0942fedc313c0daaf77f2 Mon Sep 17 00:00:00 2001 From: daniel watson Date: Fri, 4 Dec 2015 15:37:46 -0800 Subject: [PATCH] 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. --- build-stages/h_stay_on_table/h_stay_on_table.ino | 1 + 1 file changed, 1 insertion(+) 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);} -- 2.30.2