Compare commits

...

2 Commits

Author SHA1 Message Date
interfisch aee0352422 add third panel 2023-02-13 19:05:24 +01:00
interfisch 940d3c18cc fix orderarray initialization ascending 2023-02-13 19:02:11 +01:00
4 changed files with 10 additions and 10 deletions

View File

@ -31,7 +31,7 @@ D3 - _clear
#define PIN_CLEAR 12 //connects CLEAR Pin from Annax board to GND (clears column) #define PIN_CLEAR 12 //connects CLEAR Pin from Annax board to GND (clears column)
#define COLUMNBYTES 13 //4 columns per byte. one panel has 25 columns. (int)((numpanels*25)/4+1) #define COLUMNBYTES 19 //4 columns per byte. one panel has 25 columns. (int)((numpanels*25)/4+1)
//### Timings ### //### Timings ###

View File

@ -6,7 +6,7 @@
#include "flipdot.h" #include "flipdot.h"
#define COLUMNS 50 #define COLUMNS 75
#define ROWS 16 #define ROWS 16

View File

@ -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);

View File

@ -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;
@ -50,7 +50,7 @@ void loop() {
Serial.print("Update max took "); Serial.print(flip.updateDuration); Serial.println(" ms"); Serial.print("Update max took "); Serial.print(flip.updateDuration); Serial.println(" ms");
flip.updateDuration=0; //reset flip.updateDuration=0; //reset
flip.shuffleOrder(1); //flip.shuffleOrder(1);
} }
} }