summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel-Jones <daniel@danieljon.es>2017-02-22 16:20:23 +1030
committerdaniel-Jones <daniel@danieljon.es>2017-02-22 16:20:23 +1030
commitfbb63dd9f7eb402cc73abd8eeb00592fbd0c02b1 (patch)
tree1630f8001da988855608b1a234fbd5012738b579
parentd83503f9c5f9a5ef254c10255a355dfeb5ad9eb6 (diff)
downloadRGB-Controller-fbb63dd9f7eb402cc73abd8eeb00592fbd0c02b1.tar.gz
RGB-Controller-fbb63dd9f7eb402cc73abd8eeb00592fbd0c02b1.zip
This time i did it correctly, all buttons, sliders etc work as intended when disconnected.
-rw-r--r--arduino/rgb/.rgb.ino.swobin16384 -> 20480 bytes
-rw-r--r--arduino/rgb/rgb.ino12
-rwxr-xr-xqt/RGBController/RGBControllerbin92920 -> 92920 bytes
-rwxr-xr-xqt/RGBController/controllerwindow.cpp19
-rw-r--r--qt/RGBController/controllerwindow.obin103576 -> 104224 bytes
5 files changed, 29 insertions, 2 deletions
diff --git a/arduino/rgb/.rgb.ino.swo b/arduino/rgb/.rgb.ino.swo
index c9a379b..2ab1ac4 100644
--- a/arduino/rgb/.rgb.ino.swo
+++ b/arduino/rgb/.rgb.ino.swo
Binary files differ
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)
diff --git a/qt/RGBController/RGBController b/qt/RGBController/RGBController
index fec5497..1f9218c 100755
--- a/qt/RGBController/RGBController
+++ b/qt/RGBController/RGBController
Binary files differ
diff --git a/qt/RGBController/controllerwindow.cpp b/qt/RGBController/controllerwindow.cpp
index 1255491..b543ed6 100755
--- a/qt/RGBController/controllerwindow.cpp
+++ b/qt/RGBController/controllerwindow.cpp
@@ -237,7 +237,7 @@ int controllerWindow::show_question_box(QString message, QString omessage)
void controllerWindow::on_connect_button_clicked()
{
- /*
+ /*
* here we need to call our serial port connect function
* if our connection is sucessful we need to enable and disable a few buttons and widgets
* we must also change our rgb sliders etc
@@ -267,7 +267,7 @@ void controllerWindow::on_connect_button_clicked()
ui->arduino_port_dropdown->setEnabled(false);
ui->red_fade_button->setEnabled(true);
ui->green_fade_button->setEnabled(true);
- ui->green_fade_button->setEnabled(true);
+ ui->blue_fade_button->setEnabled(true);
ui->speed_button->setEnabled(true);
ui->rfrom->setEnabled(true);
ui->rto->setEnabled(true);
@@ -316,9 +316,24 @@ void controllerWindow::on_disconnect_button_clicked()
ui->r_slider->setValue(0);
ui->g_slider->setValue(0);
ui->b_slider->setValue(0);
+ ui->red_fade_button->setEnabled(false);
+ ui->green_fade_button->setEnabled(false);
+ ui->blue_fade_button->setEnabled(false);
+ ui->speed_button->setEnabled(false);
+ ui->rfrom->setEnabled(false);
+ ui->rto->setEnabled(false);
+ ui->gfrom->setEnabled(false);
+ ui->gto->setEnabled(false);
+ ui->bfrom->setEnabled(false);
+ ui->bto->setEnabled(false);
+ ui->r_speed_slider->setEnabled(false);
+ ui->g_speed_slider->setEnabled(false);
+ ui->b_speed_slider->setEnabled(false);
+ ui->speed_slider->setEnabled(false);
ui->r_speed_slider->setValue(0);
ui->g_speed_slider->setValue(0);
ui->b_speed_slider->setValue(0);
+ ui->speed_slider->setValue(0);
ui->rfrom->setValue(0);
ui->rto->setValue(0);
ui->gfrom->setValue(0);
diff --git a/qt/RGBController/controllerwindow.o b/qt/RGBController/controllerwindow.o
index 487cd2b..e2c0df4 100644
--- a/qt/RGBController/controllerwindow.o
+++ b/qt/RGBController/controllerwindow.o
Binary files differ