Skip to content

Commit

Permalink
Merge pull request #1 from hpwit/optomize
Browse files Browse the repository at this point in the history
Optomize
  • Loading branch information
hpwit authored Dec 30, 2022
2 parents c0eea56 + 3dc3367 commit 37c0d39
Show file tree
Hide file tree
Showing 5 changed files with 303 additions and 15 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,34 @@ driver.showPixels();

//displaying the leds in leds2
driver.showPixels(leds2);
```
### And if you do not wanna wait while displaying ?
`void showPixels(displayMode dispmode)` and `void showPixels(displayMode dispmode,uint8_t *newleds)` are two functions that can allow you to display the pixels without having to wait
```C
showPixels(NO_WAIT); //it will start displaying the leds but giving you back the process
showPixels(NO_WAIT,newleds); //same here
//i.e if you do this
//A
showPixels(NO_WAIT);
delay(20);
//B
//between A and B it will have passed either 20 or the time of the showPixels (if it's longer than 20ms)
```

if you do this
```C
showPixels(NO_WAIT);
showPixels(NO_WAIT);
```
then the ssocn showPixels will wait for the first one to end before starting the second one.
### 'HARDWARE SCROLLING'
to enable HARDWARE SCORLLING
#define ENABLE_HARDWARE_SCROLL
Old term for a nice trick. The idea is to do a remapping of the leds within the driver directly so that the leds are displayed in another order. Pixels are pushed one at a time, and the normal way to do it is by going led 0,1,2,3 ....,N
Let's say that I want to 'scroll' by 5 pixels all the leds. Normally you would move leds 4->N-1 into 0,N-5 and then copy led 0=>led N-4 act. and then do the fastled.show().
The way I do it is to push within the driver led 4,5,6,7, ...., N-1,0,1,2,3 by calculating each time which pixels needs to be displayed using a simple algorithm about something along this `lednumber=> (lednumber+scroll)%N` (then a bit more complicated to take into account snake arrangement or not ,...)
Expand Down
1 change: 1 addition & 0 deletions examples/panelhardwarescroll/panelhardwarescroll.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define CLOCK_PIN 16
#define LATCH_PIN 26
#define NUM_STRIPS 32
#define ENABLE_HARDWARE_SCROLL
#include "I2SClocklessVirtualLedDriver.h"
//here we have 3 colors per pixel
uint8_t leds[NUM_STRIPS*NUM_LEDS_PER_STRIP*3];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define CLOCK_PIN 16
#define LATCH_PIN 26
#define NUM_STRIPS 32
#define ENABLE_HARDWARE_SCROLL
#include "I2SClocklessVirtualLedDriver.h"
//here we have 3 colors per pixel
uint8_t leds[NUM_STRIPS*NUM_LEDS_PER_STRIP*3];
Expand Down
Binary file added extra/Gerber_PCB_4pins virtual 8-1 RJ45 copy.zip
Binary file not shown.
Loading

0 comments on commit 37c0d39

Please sign in to comment.