Написать псевдокод программы #include "Adafruit_NeoPixel.h"
#define LED_COUNT 1
#define LED_PIN 2
Adafruit_NeoPixel strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
unsigned long delayva1;
unsigned long delayva2;
unsigned long currentMillis;
int yellowColor = 0;
int pinkColor = 0;
int blueColor = 0;
int i;
int bright = 0;
int change = 3;

void setup(){
pinMode(9, OUTPUT);
}

void loop() {
currentMillis = millis();
if (currentMillis - delayva1 > 10){
delayva1 = currentMillis;
bright = bright + change;
analogWrite(9,bright);
if (bright == 255 || bright == 0){
change = -change;
}
}

if (currentMillis - delayva2 > 1000){
delayva2 = currentMillis;
i++;
switch (i % 3) {

case 0:
yellowColor = 255;
pinkColor = 255;
blueColor = 0;
break;

case 1:
yellowColor = 255;
pinkColor = 0;
blueColor = 200;
break;

case 2:
yellowColor = 0;
pinkColor = 255;
blueColor = 255;
break;
}
}
strip.setPixelColor(0, strip.Color(yellowColor, pinkColor, blueColor));
strip.show();
delay(20);
}

gjkbyf20061974 gjkbyf20061974    2   20.10.2020 21:18    0

Другие вопросы по теме Информатика