void Frame::mirror() { const std::vector<LED>& leds = getLEDs(); for (std::size_t i = 0 ; i < leds.size()/2; ++i) { unsigned int mirrorI = leds.size()-i-1; LED led(mirrorI, leds[i].getColor()); addLED(led); } }
void Foo::addLEDs(Color aColor, int aBrightness, int aStart, int aEnd) { // check values - should create a fucntion that does this if (aStart < 0) aStart = 0; if (aStart >= numLEDs) aStart = numLEDs; if (aEnd < 0) aEnd = 0; if (aEnd >= numLEDs) aEnd = numLEDs; int length = aEnd-aStart+1; for (int n=0;n<length;n++) { AddressedLED* aLED = new AddressedLED; aLED->color.setColor(aColor); aLED->brightness = aBrightness; aLED->address = aStart + n; addLED(aLED); } }