void twoBits() { int l; for (l=0; l< 8; l++) { //add a check kill switch doNote(twoBitNoteArray[l], twoBitTimeArray[l], millis()); } // just a little extra white space at the end in case it isn't followed // by a clearStrip(); doNote(0,300, millis()); } void doNote (byte colorNum, int duration, long startTime) { int d; int r; int mCheck = 0; byte color = colorArray[colorNum]; long endTime = startTime + (long) duration; // release whitespace eats into the previous note!!!!!!!! while (millis() < (endTime-release)) { //add a check_kill_switch mCheck = micros() % rateModulo; if (mCheck==0) { //Serial.println(mCheck); mystrip.pushCmd(color); mystrip.latch(); } } while (millis() < endTime) { //add a check_kill_switch mCheck = micros() % rateModulo; if (mCheck==0) { mystrip.pushCmd(colorArray[0]); mystrip.latch(); } } }
No comments:
Post a Comment