summaryrefslogtreecommitdiff
path: root/arduino/rgb/rgb.ino
diff options
context:
space:
mode:
Diffstat (limited to 'arduino/rgb/rgb.ino')
-rw-r--r--arduino/rgb/rgb.ino12
1 files changed, 12 insertions, 0 deletions
diff --git a/arduino/rgb/rgb.ino b/arduino/rgb/rgb.ino
index 7a0294b..195eff2 100644
--- a/arduino/rgb/rgb.ino
+++ b/arduino/rgb/rgb.ino
@@ -53,6 +53,10 @@ void setup()
void red_thread()
{
+ if (red < rf)
+ red = rf;
+ if (red > rt)
+ red = rf;
if (red == rt)
r_rev = true;
if (red == rf)
@@ -65,6 +69,10 @@ void red_thread()
void green_thread()
{
+ if (red < rf)
+ green = gf;
+ if (green > gt)
+ green = gf;
if (green == gt)
g_rev = true;
if (green == gf)
@@ -78,6 +86,10 @@ void green_thread()
void blue_thread()
{
+ if (blue < bf)
+ red = bf;
+ if (blue > bt)
+ blue = bf;
if (blue == bt)
b_rev = true;
if (blue == bf)