Korekta GREEN - RED
obsługa kolorowania diody poziomu wody
This commit is contained in:
@@ -9,9 +9,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define LED_PIN 5
|
#define LED_PIN 5
|
||||||
#define LED_COUNT 9
|
#define LED_COUNT 9
|
||||||
const uint8_t ledMap[LED_COUNT] = {3, 0, 1, 8, 2, 5, 4, 7, 6};
|
const uint8_t ledMap[LED_COUNT] = { 3, 0, 1, 8, 2, 5, 4, 7, 6 };
|
||||||
|
|
||||||
//2DO:
|
//2DO:
|
||||||
//Pomiar światła bh1750 i fotorezystor
|
//Pomiar światła bh1750 i fotorezystor
|
||||||
@@ -24,24 +24,24 @@ const uint8_t ledMap[LED_COUNT] = {3, 0, 1, 8, 2, 5, 4, 7, 6};
|
|||||||
#define SCREEN_WIDTH 128
|
#define SCREEN_WIDTH 128
|
||||||
#define SCREEN_HEIGHT 32
|
#define SCREEN_HEIGHT 32
|
||||||
|
|
||||||
#define OLED_RESET -1
|
#define OLED_RESET -1
|
||||||
#define SCREEN_ADDRESS 0x3C
|
#define SCREEN_ADDRESS 0x3C
|
||||||
|
|
||||||
//PINS
|
//PINS
|
||||||
#define BTN_DIMM 34 //GPIO34 D34
|
#define BTN_DIMM 34 //GPIO34 D34
|
||||||
#define BTN_RST 35 //GPIO35 D35
|
#define BTN_RST 35 //GPIO35 D35
|
||||||
#define BTN_HYGRSTT 36 //GPIO36 VP
|
#define BTN_HYGRSTT 36 //GPIO36 VP
|
||||||
#define BTN_SPEED 39 //GPIO35 VN
|
#define BTN_SPEED 39 //GPIO35 VN
|
||||||
#define PIN_SPEED_1 32 //GPIO32 D32
|
#define PIN_SPEED_1 32 //GPIO32 D32
|
||||||
#define PIN_SPEED_2 14 //GPIO36 D14
|
#define PIN_SPEED_2 14 //GPIO36 D14
|
||||||
#define DHTPIN 4 //GPIO04 D4
|
#define DHTPIN 4 //GPIO04 D4
|
||||||
#define LED_WHT_TANK 25 //GPIO26 D26
|
#define LED_WHT_TANK 25 //GPIO26 D26
|
||||||
#define LED_RED_TANK 26 //GPIO25 D25
|
#define LED_RED_TANK 26 //GPIO25 D25
|
||||||
#define NEOPIXEL 27 //GPIO04 D27
|
#define NEOPIXEL 27 //GPIO04 D27
|
||||||
#define IN_PHOTOTRA 12
|
#define IN_PHOTOTRA 12
|
||||||
#define WTR_LVL 33 //GPIO04 D27
|
#define WTR_LVL 33 //GPIO04 D27
|
||||||
|
|
||||||
#define DIMM_MAX_VALUE 3 // docelowo 4, tylko na testy
|
#define DIMM_MAX_VALUE 3 // docelowo 4, tylko na testy
|
||||||
|
|
||||||
//NEO PIXEL ARDESES:
|
//NEO PIXEL ARDESES:
|
||||||
#define NEOPXL_MULTIPLIER 25
|
#define NEOPXL_MULTIPLIER 25
|
||||||
@@ -55,7 +55,7 @@ const uint8_t ledMap[LED_COUNT] = {3, 0, 1, 8, 2, 5, 4, 7, 6};
|
|||||||
#define ADR_NEOPXL_L4 7
|
#define ADR_NEOPXL_L4 7
|
||||||
#define ADR_NEOPXL_L5 6
|
#define ADR_NEOPXL_L5 6
|
||||||
#define ADR_NEOPXL_WATERLVL 8
|
#define ADR_NEOPXL_WATERLVL 8
|
||||||
#define ADR_NEOPXL_TANK
|
#define ADR_NEOPXL_TANK
|
||||||
|
|
||||||
#define NON_ACTIVE_LED_DIVIDER 8
|
#define NON_ACTIVE_LED_DIVIDER 8
|
||||||
|
|
||||||
@@ -67,20 +67,20 @@ BH1750 lightMeter;
|
|||||||
|
|
||||||
|
|
||||||
//MAIN VALUES VARIABLES
|
//MAIN VALUES VARIABLES
|
||||||
int8_t resetVal = 0;
|
int8_t resetVal = 0;
|
||||||
int8_t fanSpeedVal = 1;
|
int8_t fanSpeedVal = 1;
|
||||||
int8_t hygrostatVal = 55;
|
int8_t hygrostatVal = 55;
|
||||||
int8_t dimmStep = 1;
|
int8_t dimmStep = 1;
|
||||||
int8_t dimmVal = 1;
|
int8_t dimmVal = 1;
|
||||||
int8_t waterLvlVal = 0;
|
int8_t waterLvlVal = 0;
|
||||||
int8_t photoVal = 0;
|
int8_t photoVal = 0;
|
||||||
float temp = 0.0;
|
float temp = 0.0;
|
||||||
float hum = 0.0;
|
float hum = 0.0;
|
||||||
float lux = 0.0;
|
float lux = 0.0;
|
||||||
|
|
||||||
//NEOPIXELS VARIABLES
|
//NEOPIXELS VARIABLES
|
||||||
int8_t neoPixelSwitch = 1;
|
int8_t neoPixelSwitch = 1;
|
||||||
int8_t neoPixelRed = 10;
|
int8_t neoPixelRed = 0;
|
||||||
int8_t neoPixelGreen = 10;
|
int8_t neoPixelGreen = 10;
|
||||||
int8_t neoPixelBlue = 10;
|
int8_t neoPixelBlue = 10;
|
||||||
|
|
||||||
@@ -94,32 +94,32 @@ int8_t neoPixelLvl_4 = 1;
|
|||||||
int8_t neoPixelLvl_5 = 1;
|
int8_t neoPixelLvl_5 = 1;
|
||||||
int8_t neoPixelWaterLvlR = 1;
|
int8_t neoPixelWaterLvlR = 1;
|
||||||
int8_t neoPixelWaterLvlG = 1;
|
int8_t neoPixelWaterLvlG = 1;
|
||||||
|
int8_t neoPixelWaterLvlB = 1;
|
||||||
int8_t neoPixelTank = 1;
|
int8_t neoPixelTank = 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void IRAM_ATTR dimmButtonFcn() {
|
void IRAM_ATTR dimmButtonFcn() {
|
||||||
dimmStep ++;
|
dimmStep++;
|
||||||
if (dimmStep > DIMM_MAX_VALUE) {
|
if (dimmStep > DIMM_MAX_VALUE) {
|
||||||
dimmStep = 0;
|
dimmStep = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void IRAM_ATTR speedButtonFcn() {
|
void IRAM_ATTR speedButtonFcn() {
|
||||||
fanSpeedVal ++;
|
fanSpeedVal++;
|
||||||
if (fanSpeedVal >= 3) {
|
if (fanSpeedVal >= 3) {
|
||||||
fanSpeedVal = 1;
|
fanSpeedVal = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
void IRAM_ATTR hygrostatButtonFcn() {
|
void IRAM_ATTR hygrostatButtonFcn() {
|
||||||
hygrostatVal = hygrostatVal + 5;
|
hygrostatVal = hygrostatVal + 5;
|
||||||
if (hygrostatVal > 65) {
|
if (hygrostatVal > 65) {
|
||||||
hygrostatVal = 45;
|
hygrostatVal = 45;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setFanSpeed (uint8_t spdInpt){
|
void setFanSpeed(uint8_t spdInpt) {
|
||||||
if (spdInpt == 1) {
|
if (spdInpt == 1) {
|
||||||
delay(100);
|
delay(100);
|
||||||
digitalWrite(PIN_SPEED_2, LOW);
|
digitalWrite(PIN_SPEED_2, LOW);
|
||||||
@@ -143,7 +143,7 @@ void setFanSpeed (uint8_t spdInpt){
|
|||||||
|
|
||||||
void rainbowCycle(uint8_t wait) {
|
void rainbowCycle(uint8_t wait) {
|
||||||
uint16_t i, j;
|
uint16_t i, j;
|
||||||
for (j = 0; j < 256 * 3; j++) { // mniej cykli niż 5 — szybciej wraca
|
for (j = 0; j < 256 * 3; j++) { // mniej cykli niż 5 — szybciej wraca
|
||||||
for (i = 0; i < LED_COUNT; i++) {
|
for (i = 0; i < LED_COUNT; i++) {
|
||||||
uint8_t physIndex = ledMap[i]; // mapowanie pozycji logicznej na fizyczną
|
uint8_t physIndex = ledMap[i]; // mapowanie pozycji logicznej na fizyczną
|
||||||
pixels.setPixelColor(physIndex, Wheel((i * 256 / LED_COUNT + j) & 255));
|
pixels.setPixelColor(physIndex, Wheel((i * 256 / LED_COUNT + j) & 255));
|
||||||
@@ -178,7 +178,7 @@ uint32_t Wheel(byte pos) {
|
|||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
|
if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
|
||||||
Serial.println(F("SSD1306 allocation failed"));
|
Serial.println(F("SSD1306 allocation failed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,57 +224,57 @@ void setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
// ###################################################
|
// ###################################################
|
||||||
// WYŚWIETLACZ
|
// WYŚWIETLACZ
|
||||||
display.clearDisplay();
|
display.clearDisplay();
|
||||||
display.setCursor(90, 0);
|
display.setCursor(90, 0);
|
||||||
display.println(Version);
|
display.println(Version);
|
||||||
|
|
||||||
display.setCursor(0, 0);
|
display.setCursor(0, 0);
|
||||||
display.println("RST:");
|
display.println("RST:");
|
||||||
display.setCursor(25, 0);
|
display.setCursor(25, 0);
|
||||||
display.println(resetVal);
|
display.println(resetVal);
|
||||||
|
|
||||||
display.setCursor(35, 0);
|
display.setCursor(35, 0);
|
||||||
display.println("L:");
|
display.println("L:");
|
||||||
display.setCursor(47, 0);
|
display.setCursor(47, 0);
|
||||||
display.println(lux);
|
display.println(lux);
|
||||||
|
|
||||||
display.setCursor(0, 10);
|
display.setCursor(0, 10);
|
||||||
display.println("WtrLvl:");
|
display.println("WtrLvl:");
|
||||||
display.setCursor(50, 10);
|
display.setCursor(50, 10);
|
||||||
display.println(waterLvlVal);
|
display.println(waterLvlVal);
|
||||||
display.setCursor(70, 10);
|
display.setCursor(70, 10);
|
||||||
display.println("FanSpd:");
|
display.println("FanSpd:");
|
||||||
display.setCursor(115, 10);
|
display.setCursor(115, 10);
|
||||||
display.println(fanSpeedVal);
|
display.println(fanSpeedVal);
|
||||||
|
|
||||||
// display.setCursor(0, 10);
|
// display.setCursor(0, 10);
|
||||||
// display.println("FanSpd:");
|
// display.println("FanSpd:");
|
||||||
// display.setCursor(50, 10);
|
// display.setCursor(50, 10);
|
||||||
// display.println(fanSpeedVal);
|
// display.println(fanSpeedVal);
|
||||||
//
|
//
|
||||||
// display.setCursor(70, 10);
|
// display.setCursor(70, 10);
|
||||||
// display.println("Hygst:");
|
// display.println("Hygst:");
|
||||||
// display.setCursor(115, 10);
|
// display.setCursor(115, 10);
|
||||||
// display.println(hygrostatVal);
|
// display.println(hygrostatVal);
|
||||||
|
|
||||||
display.setCursor(0, 20);
|
|
||||||
display.println("Hum:");
|
|
||||||
display.setCursor(28, 20);
|
|
||||||
display.println(hum);
|
|
||||||
|
|
||||||
// display.setCursor(0, 20);
|
|
||||||
// display.println("Ph:");
|
|
||||||
// display.setCursor(28, 20);
|
|
||||||
// display.println(photoVal);
|
|
||||||
|
|
||||||
display.setCursor(70, 20);
|
display.setCursor(0, 20);
|
||||||
display.println("Dimm:");
|
display.println("Hum:");
|
||||||
display.setCursor(115, 20);
|
display.setCursor(28, 20);
|
||||||
display.println(dimmStep);
|
display.println(hum);
|
||||||
|
|
||||||
display.display();
|
// display.setCursor(0, 20);
|
||||||
|
// display.println("Ph:");
|
||||||
|
// display.setCursor(28, 20);
|
||||||
|
// display.println(photoVal);
|
||||||
|
|
||||||
|
display.setCursor(70, 20);
|
||||||
|
display.println("Dimm:");
|
||||||
|
display.setCursor(115, 20);
|
||||||
|
display.println(dimmStep);
|
||||||
|
|
||||||
|
display.display();
|
||||||
|
|
||||||
display.setCursor(70, 20);
|
display.setCursor(70, 20);
|
||||||
display.println("Dimm:");
|
display.println("Dimm:");
|
||||||
@@ -292,48 +292,48 @@ void loop() {
|
|||||||
|
|
||||||
// #################################################################
|
// #################################################################
|
||||||
// LOGIKA
|
// LOGIKA
|
||||||
|
if (digitalRead(BTN_RST) == HIGH) {
|
||||||
|
unsigned long startTime = millis();
|
||||||
|
while (digitalRead(BTN_RST) == HIGH && millis() - startTime < 4000) {
|
||||||
|
display.clearDisplay();
|
||||||
|
display.setCursor(20, 0);
|
||||||
|
display.println("Resetowanie... 4s");
|
||||||
|
display.display();
|
||||||
|
delay(100);
|
||||||
|
}
|
||||||
if (digitalRead(BTN_RST) == HIGH) {
|
if (digitalRead(BTN_RST) == HIGH) {
|
||||||
unsigned long startTime = millis();
|
resetVal = 1;
|
||||||
while (digitalRead(BTN_RST) == HIGH && millis() - startTime < 4000) {
|
display.clearDisplay();
|
||||||
display.clearDisplay();
|
display.setCursor(0, 0);
|
||||||
display.setCursor(20, 0);
|
display.println("Zresetowano");
|
||||||
display.println("Resetowanie... 4s");
|
display.display();
|
||||||
display.display();
|
delay(500);
|
||||||
delay(100);
|
}
|
||||||
}
|
}
|
||||||
if (digitalRead(BTN_RST) == HIGH) {
|
|
||||||
resetVal = 1;
|
|
||||||
display.clearDisplay();
|
|
||||||
display.setCursor(0, 0);
|
|
||||||
display.println("Zresetowano");
|
|
||||||
display.display();
|
|
||||||
delay(500);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// jeśli nieosiągnieto bliskiej wilgotności - zaświec diody
|
// jeśli nieosiągnieto bliskiej wilgotności - zaświec diody
|
||||||
// jeśli osiągnięto bliską wilgotność na 2 biegu zaświeć jedną i przciemnij drugą
|
// jeśli osiągnięto bliską wilgotność na 2 biegu zaświeć jedną i przciemnij drugą
|
||||||
// jeśli osiągnięto wilgotność przyciemnij diody zależnie od biegu
|
// jeśli osiągnięto wilgotność przyciemnij diody zależnie od biegu
|
||||||
if (hum > hygrostatVal) {
|
if (hum > hygrostatVal) {
|
||||||
setFanSpeed (0);
|
setFanSpeed(0);
|
||||||
neoPixelSpeed_1 = 1;
|
neoPixelSpeed_1 = 1;
|
||||||
neoPixelSpeed_2 = 0;
|
neoPixelSpeed_2 = 0;
|
||||||
|
|
||||||
if (fanSpeedVal == 2){
|
if (fanSpeedVal == 2) {
|
||||||
neoPixelSpeed_2 = 1;
|
|
||||||
}
|
|
||||||
} else if (hum >= (hygrostatVal - 5) and fanSpeedVal == 2) {
|
|
||||||
setFanSpeed (1); //ustaw predkość 1 zbliża sie do docelowej wartości
|
|
||||||
neoPixelSpeed_1 = NON_ACTIVE_LED_DIVIDER;
|
|
||||||
neoPixelSpeed_2 = 1;
|
neoPixelSpeed_2 = 1;
|
||||||
} else if (hum < hygrostatVal) {
|
}
|
||||||
setFanSpeed (fanSpeedVal);
|
} else if (hum >= (hygrostatVal - 5) and fanSpeedVal == 2) {
|
||||||
neoPixelSpeed_1 = NON_ACTIVE_LED_DIVIDER;
|
setFanSpeed(1); //ustaw predkość 1 zbliża sie do docelowej wartości
|
||||||
if (fanSpeedVal == 1){
|
neoPixelSpeed_1 = NON_ACTIVE_LED_DIVIDER;
|
||||||
neoPixelSpeed_2 = 0;
|
neoPixelSpeed_2 = 1;
|
||||||
} else {
|
} else if (hum < hygrostatVal) {
|
||||||
neoPixelSpeed_2 = NON_ACTIVE_LED_DIVIDER;
|
setFanSpeed(fanSpeedVal);
|
||||||
}
|
neoPixelSpeed_1 = NON_ACTIVE_LED_DIVIDER;
|
||||||
|
if (fanSpeedVal == 1) {
|
||||||
|
neoPixelSpeed_2 = 0;
|
||||||
|
} else {
|
||||||
|
neoPixelSpeed_2 = NON_ACTIVE_LED_DIVIDER;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dimmStep == 0) {
|
if (dimmStep == 0) {
|
||||||
@@ -393,48 +393,63 @@ void loop() {
|
|||||||
neoPixelLvl_5 = 1;
|
neoPixelLvl_5 = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dimmStep == 0 ){
|
// wartości zależne od sposobu zasilania PC/Powerbank/Ładowarka
|
||||||
analogWrite(LED_WHT_TANK, 0);
|
|
||||||
|
//46-47 - sonda nie dotyka wody
|
||||||
|
//26 - ledwo na dnie
|
||||||
|
// 25 jest troche wody
|
||||||
|
// 24-25 połowa zbiornika
|
||||||
|
// 23-24 pełen zbiornik
|
||||||
|
|
||||||
|
if (waterLvlVal >= 38) { // Empty TANK
|
||||||
|
neoPixelWaterLvlR = 10;
|
||||||
|
neoPixelWaterLvlG = 0;
|
||||||
|
neoPixelWaterLvlB = 0;
|
||||||
|
analogWrite(LED_WHT_TANK, dimmVal * 8);
|
||||||
analogWrite(LED_RED_TANK, 0);
|
analogWrite(LED_RED_TANK, 0);
|
||||||
} else {
|
// tu set fan
|
||||||
if (waterLvlVal >= 45 ) { // waterLvlVal > 45 znnaczy bez wiody
|
}
|
||||||
neoPixelWaterLvlR = 1;
|
if (waterLvlVal < 40 && waterLvlVal >= 25) { //a bit of water TANK
|
||||||
neoPixelWaterLvlG = 0; //Przygotowanie pod żółty kolor jak mało wody
|
neoPixelWaterLvlR = 10;
|
||||||
analogWrite(LED_WHT_TANK, 0);
|
neoPixelWaterLvlG = 10;
|
||||||
analogWrite(LED_RED_TANK, dimmVal*NON_ACTIVE_LED_DIVIDER);
|
neoPixelWaterLvlB = 0;
|
||||||
} else {
|
analogWrite(LED_WHT_TANK, 0);
|
||||||
neoPixelWaterLvlR = 0;
|
analogWrite(LED_RED_TANK, dimmVal * 8);
|
||||||
neoPixelWaterLvlG = 1;
|
}
|
||||||
analogWrite(LED_WHT_TANK, dimmVal*NON_ACTIVE_LED_DIVIDER);
|
if (waterLvlVal <= 24) { // FULL TANK
|
||||||
analogWrite(LED_RED_TANK, 0);
|
neoPixelWaterLvlR = neoPixelRed;
|
||||||
}
|
neoPixelWaterLvlG = neoPixelGreen;
|
||||||
|
neoPixelWaterLvlB = neoPixelBlue;
|
||||||
|
analogWrite(LED_WHT_TANK, 0);
|
||||||
|
analogWrite(LED_RED_TANK, dimmVal * 8);
|
||||||
|
// tu set fan
|
||||||
}
|
}
|
||||||
|
|
||||||
// if minął czas -> resetVal = 0;
|
|
||||||
|
|
||||||
if (resetVal == 1 ){
|
// if minął czas -> resetVal = 0;
|
||||||
neoPixelFilter = 0;
|
|
||||||
} else {
|
if (resetVal == 1) {
|
||||||
neoPixelFilter = 1;
|
neoPixelFilter = 0;
|
||||||
}
|
} else {
|
||||||
|
neoPixelFilter = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
delay(100);
|
delay(100);
|
||||||
//NEOPIXELS
|
//NEOPIXELS
|
||||||
// #################################################################
|
// #################################################################
|
||||||
// #################################################################
|
// #################################################################
|
||||||
pixels.clear();
|
pixels.clear();
|
||||||
pixels.setPixelColor(ADR_NEOPXL_SPEED_1, pixels.Color(int((neoPixelRed*dimmVal*neoPixelSwitch*neoPixelSpeed_1)/NON_ACTIVE_LED_DIVIDER), int((neoPixelGreen*dimmVal*neoPixelSwitch*neoPixelSpeed_1)/NON_ACTIVE_LED_DIVIDER), int((neoPixelBlue*dimmVal*neoPixelSwitch*neoPixelSpeed_1)/NON_ACTIVE_LED_DIVIDER)));
|
pixels.setPixelColor(ADR_NEOPXL_SPEED_1, pixels.Color(int((neoPixelGreen * dimmVal * neoPixelSwitch * neoPixelSpeed_1) / NON_ACTIVE_LED_DIVIDER), int((neoPixelRed * dimmVal * neoPixelSwitch * neoPixelSpeed_1) / NON_ACTIVE_LED_DIVIDER), int((neoPixelBlue * dimmVal * neoPixelSwitch * neoPixelSpeed_1) / NON_ACTIVE_LED_DIVIDER)));
|
||||||
pixels.setPixelColor(ADR_NEOPXL_SPEED_2, pixels.Color(int((neoPixelRed*dimmVal*neoPixelSwitch*neoPixelSpeed_2)/NON_ACTIVE_LED_DIVIDER), int((neoPixelGreen*dimmVal*neoPixelSwitch*neoPixelSpeed_2)/NON_ACTIVE_LED_DIVIDER), int((neoPixelBlue*dimmVal*neoPixelSwitch*neoPixelSpeed_2)/NON_ACTIVE_LED_DIVIDER)));
|
pixels.setPixelColor(ADR_NEOPXL_SPEED_2, pixels.Color(int((neoPixelGreen * dimmVal * neoPixelSwitch * neoPixelSpeed_2) / NON_ACTIVE_LED_DIVIDER), int((neoPixelRed * dimmVal * neoPixelSwitch * neoPixelSpeed_2) / NON_ACTIVE_LED_DIVIDER), int((neoPixelBlue * dimmVal * neoPixelSwitch * neoPixelSpeed_2) / NON_ACTIVE_LED_DIVIDER)));
|
||||||
pixels.setPixelColor(ADR_NEOPXL_FILTER, pixels.Color(neoPixelRed*dimmVal*neoPixelSwitch*neoPixelFilter, neoPixelGreen*dimmVal*neoPixelSwitch*neoPixelFilter, neoPixelBlue*dimmVal*neoPixelSwitch*neoPixelFilter));
|
pixels.setPixelColor(ADR_NEOPXL_FILTER, pixels.Color(neoPixelGreen * dimmVal * neoPixelSwitch * neoPixelFilter, neoPixelRed * dimmVal * neoPixelSwitch * neoPixelFilter, neoPixelBlue * dimmVal * neoPixelSwitch * neoPixelFilter));
|
||||||
pixels.setPixelColor(ADR_NEOPXL_L1, pixels.Color(neoPixelRed*dimmVal*neoPixelSwitch*neoPixelLvl_1, neoPixelGreen*dimmVal*neoPixelSwitch*neoPixelLvl_1, neoPixelBlue*dimmVal*neoPixelSwitch*neoPixelLvl_1));
|
pixels.setPixelColor(ADR_NEOPXL_L1, pixels.Color(neoPixelGreen * dimmVal * neoPixelSwitch * neoPixelLvl_1, neoPixelRed * dimmVal * neoPixelSwitch * neoPixelLvl_1, neoPixelBlue * dimmVal * neoPixelSwitch * neoPixelLvl_1));
|
||||||
pixels.setPixelColor(ADR_NEOPXL_L2, pixels.Color(neoPixelRed*dimmVal*neoPixelSwitch*neoPixelLvl_2, neoPixelGreen*dimmVal*neoPixelSwitch*neoPixelLvl_2, neoPixelBlue*dimmVal*neoPixelSwitch*neoPixelLvl_2));
|
pixels.setPixelColor(ADR_NEOPXL_L2, pixels.Color(neoPixelGreen * dimmVal * neoPixelSwitch * neoPixelLvl_2, neoPixelRed * dimmVal * neoPixelSwitch * neoPixelLvl_2, neoPixelBlue * dimmVal * neoPixelSwitch * neoPixelLvl_2));
|
||||||
pixels.setPixelColor(ADR_NEOPXL_L3, pixels.Color(neoPixelRed*dimmVal*neoPixelSwitch*neoPixelLvl_3, neoPixelGreen*dimmVal*neoPixelSwitch*neoPixelLvl_3, neoPixelBlue*dimmVal*neoPixelSwitch*neoPixelLvl_3));
|
pixels.setPixelColor(ADR_NEOPXL_L3, pixels.Color(neoPixelGreen * dimmVal * neoPixelSwitch * neoPixelLvl_3, neoPixelRed * dimmVal * neoPixelSwitch * neoPixelLvl_3, neoPixelBlue * dimmVal * neoPixelSwitch * neoPixelLvl_3));
|
||||||
pixels.setPixelColor(ADR_NEOPXL_L4, pixels.Color(neoPixelRed*dimmVal*neoPixelSwitch*neoPixelLvl_4, neoPixelGreen*dimmVal*neoPixelSwitch*neoPixelLvl_4, neoPixelBlue*dimmVal*neoPixelSwitch*neoPixelLvl_4));
|
pixels.setPixelColor(ADR_NEOPXL_L4, pixels.Color(neoPixelGreen * dimmVal * neoPixelSwitch * neoPixelLvl_4, neoPixelRed * dimmVal * neoPixelSwitch * neoPixelLvl_4, neoPixelBlue * dimmVal * neoPixelSwitch * neoPixelLvl_4));
|
||||||
pixels.setPixelColor(ADR_NEOPXL_L5, pixels.Color(neoPixelRed*dimmVal*neoPixelSwitch*neoPixelLvl_5, neoPixelGreen*dimmVal*neoPixelSwitch*neoPixelLvl_5, neoPixelBlue*dimmVal*neoPixelSwitch*neoPixelLvl_5));
|
pixels.setPixelColor(ADR_NEOPXL_L5, pixels.Color(neoPixelGreen * dimmVal * neoPixelSwitch * neoPixelLvl_5, neoPixelRed * dimmVal * neoPixelSwitch * neoPixelLvl_5, neoPixelBlue * dimmVal * neoPixelSwitch * neoPixelLvl_5));
|
||||||
pixels.setPixelColor(ADR_NEOPXL_WATERLVL, pixels.Color(neoPixelRed*dimmVal*neoPixelSwitch*neoPixelWaterLvlR, neoPixelGreen*dimmVal*neoPixelSwitch*neoPixelWaterLvlG, 0));
|
pixels.setPixelColor(ADR_NEOPXL_WATERLVL, pixels.Color(dimmVal * neoPixelSwitch * neoPixelWaterLvlG, dimmVal * neoPixelSwitch * neoPixelWaterLvlR, dimmVal * neoPixelSwitch * neoPixelWaterLvlB));
|
||||||
// pixels.setPixelColor(ADR_NEOPXL_TANK, pixels.Color(neoPixelRed*dimmVal*neoPixelSwitch*neoPixelTank, neoPixelGreen*dimmVal*neoPixelSwitch*neoPixelTank, neoPixelBlue*dimmVal*neoPixelSwitch*neoPixelTank));
|
// pixels.setPixelColor(ADR_NEOPXL_TANK, pixels.Color(neoPixelGreen*dimmVal*neoPixelSwitch*neoPixelTank, neoPixelRed*dimmVal*neoPixelSwitch*neoPixelTank, neoPixelBlue*dimmVal*neoPixelSwitch*neoPixelTank));
|
||||||
pixels.show();
|
pixels.show();
|
||||||
// rainbowCycle(10); // im mniejsza liczba, tym szybsza animacja
|
// rainbowCycle(10); // im mniejsza liczba, tym szybsza animacja
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user