void playPattern(int *timer, int duration, int *step) { *timer = *timer >= duration ? 0 : *timer+1; usleep(1000); if(*timer == 0) { for(int i=0; i