String str = "HTTP/1.1 200 OK\nDate: Wed, 07 Dec 2022 14:05:38 GMT\nContent-Type: text/html; charset=UTF-8\nContent-Length: 2\nConnection: close\nServer: Jino.ru/mod_pizza\nVary: Accept-Encoding\n\n2A";
const int L1 = 2;
const int L2 = 3;
const int L3 = 4;
const int L4 = 5;
const int L5 = 6;
const int L6 = 7;
unsigned long animationTimer;
int brightness = 0;
int fadeAmount = 5;
String mode = "0";
void setup() {
Serial.begin(9600);
delay(1000);
Serial.println(str);
pinMode(L1, OUTPUT); digitalWrite(L1, LOW);
pinMode(L2, OUTPUT); digitalWrite(L2, LOW);
pinMode(L3, OUTPUT); digitalWrite(L3, LOW);
pinMode(L4, OUTPUT); digitalWrite(L4, LOW);
pinMode(L5, OUTPUT); digitalWrite(L5, LOW);
pinMode(L6, OUTPUT); digitalWrite(L6, LOW);
}
void loop() {
if (millis() > animationTimer) {
animationTimer = millis() + 50;
stepAnimation();
}
}
void stepAnimation() {
if(mode == "0"){
brightness += fadeAmount;
if (brightness <= 0 || brightness >= 255) fadeAmount = -fadeAmount;
analogWrite(L1, 0);
analogWrite(L2, brightness);
analogWrite(L3, 0);
analogWrite(L4, brightness);
analogWrite(L5, 0);
analogWrite(L6, brightness);
}else if(mode == "1"){
brightness += fadeAmount;
if (brightness <= 0 || brightness >= 255) fadeAmount = -fadeAmount;
analogWrite(L1, brightness);
analogWrite(L2, 0);
analogWrite(L3, brightness);
analogWrite(L4, 0);
analogWrite(L5, brightness);
analogWrite(L6, 0);
}
}