From 0af25befe6f465d3ef713fed543efb682c8d0e46 Mon Sep 17 00:00:00 2001 From: Vikturix Date: Tue, 14 Feb 2023 21:54:23 +0000 Subject: [PATCH] a few futile comments --- inefficient-rgb/inefficient-rgb.ino | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/inefficient-rgb/inefficient-rgb.ino b/inefficient-rgb/inefficient-rgb.ino index 72512ea..df3831d 100644 --- a/inefficient-rgb/inefficient-rgb.ino +++ b/inefficient-rgb/inefficient-rgb.ino @@ -11,7 +11,7 @@ int gV; int bV; long counter; -String COLOUR = "#AAAAAA"; +String COLOUR = "#0000e0"; void setup() { // put your setup code here, to run once: @@ -27,19 +27,23 @@ void setup() { bH = COLOUR.charAt(5); bH.concat(COLOUR.charAt(6)); + //base is 16, as long as input is fine, this should work rV = strtoul(rH.c_str(),NULL,16); gV = strtoul(gH.c_str(),NULL,16); bV = strtoul(bH.c_str(),NULL,16); - /*Serial.begin(9600); + Serial.begin(9600); Serial.println(rV); Serial.println(gV); - Serial.println(bV);*/ + Serial.println(bV); } void loop() { // put your main code here, to run repeatedly: + // modulus will reach 0 at counter = 256 int temp = counter % 256; + // any above 0 value of rV will get red led to glow + // or any value that is less than the counter if (temp < rV) { digitalWrite(red,HIGH); } else {