如何在“如果”中使用“ for”?

时间:2019-12-30 13:39:51

标签: c++ for-loop if-statement

我该如何工作? for不会加入if

if (data.tSwitch2 == 1) {
    for(int b=1;b<4;b++){
        unsigned long current_time=millis();
        if(current_time - timestamp > interval){
            Serial.println(b);
            leds[b].setRGB(255,255,0);  // Setze Scheinwerferfarbe HIER!!!
            leds[b].fadeLightBy(ledbrightness);
            timestamp = current_time;
            // don't forget FastLED.show(), to output the colors
        }
        FastLED.show();
    }
}

0 个答案:

没有答案