Skip to content

Commit

Permalink
allow -m <millis> to modify fade time of --playpattern
Browse files Browse the repository at this point in the history
  • Loading branch information
todbot committed Aug 5, 2019
1 parent a7ccc37 commit ab2230d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion blink1-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ int parsePattern( char* str, int* repeats, patternline_t* pattern )
int i=0;
s = strtok(NULL, ","); // prep next parse
while( s != NULL ) {
printf("s:'%s'\n",s);
//printf("s:'%s'\n",s);
parsecolor( &pattern[i].color, s );

s = strtok(NULL, ",");
Expand Down
9 changes: 7 additions & 2 deletions blink1-tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,8 +857,13 @@ int main(int argc, char** argv)
for( int i=0; i<pattlen; i++ ) {
patternline_t pat = pattern[i];
//msg("%d: %2.2x,%2.2x,%2.2x : %d : %d\n", i, pat.color.r,pat.color.r,pat.color.b, pat.millis,pat.ledn );
msg("%d:",repeats);
blink1_fadeToRGBForDevices( pat.millis/2, pat.color.r,pat.color.g,pat.color.b, pat.ledn);
//msg("%d:",repeats);
uint16_t m = (millis!=-1) ? millis : pat.millis/2;
uint8_t r = pat.color.r;
uint8_t g = pat.color.g;
uint8_t b = pat.color.b;
blink1_adjustBrightness( brightness, &r, &g, &b);
blink1_fadeToRGBForDevices( m, r,g,b, pat.ledn);
blink1_sleep( pat.millis );
}
}
Expand Down

0 comments on commit ab2230d

Please sign in to comment.