fix orderarray initialization ascending
This commit is contained in:
parent
5f2beca1d0
commit
940d3c18cc
|
@ -20,7 +20,7 @@ void Image::init()
|
||||||
|
|
||||||
flag_updating=false;
|
flag_updating=false;
|
||||||
update_counter=0;
|
update_counter=0;
|
||||||
updateDelay=5;
|
updateDelay=10;
|
||||||
|
|
||||||
resetOrder(true);
|
resetOrder(true);
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,11 @@ void Image::setBuffer_random(uint8_t randomness)
|
||||||
|
|
||||||
void Image::resetOrder(bool ascending) {
|
void Image::resetOrder(bool ascending) {
|
||||||
for (uint8_t i=0;i<getW();i++) { //fill with ascending numbers
|
for (uint8_t i=0;i<getW();i++) { //fill with ascending numbers
|
||||||
orderArray[i]=(getW()-1)*!ascending - i;
|
if (ascending) {
|
||||||
|
orderArray[i]=i;
|
||||||
|
}else{
|
||||||
|
orderArray[i]=(getW()-1) - i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,10 +106,6 @@ UpdateReturn Image::updateByColumn(bool clearFirst, bool optimizeClear, bool opt
|
||||||
unsigned long functionStartMillis=millis();
|
unsigned long functionStartMillis=millis();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uint8_t x=update_counter/2;
|
uint8_t x=update_counter/2;
|
||||||
bool setDot = (update_counter%2==1);
|
bool setDot = (update_counter%2==1);
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ void loop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
UpdateReturn result=flip.updateByColumn(true,true,true,true); //0=not finished, 1=finished
|
UpdateReturn result=flip.updateByColumn(true,true,true); //0=not finished, 1=finished
|
||||||
if (result == finished) //just finished
|
if (result == finished) //just finished
|
||||||
{
|
{
|
||||||
unsigned long duration=millis()-last_change;
|
unsigned long duration=millis()-last_change;
|
||||||
|
|
Loading…
Reference in New Issue