Advertisement
legocoachandy

Simon - showSequence

Jul 21st, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. ///////////////////////////////////////////////////////////////////////////////
  2. void showSequence() {
  3. // Set tone playback duration based on current sequence length
  4. uint16_t toneDuration;
  5. if (currentStep<=5) {
  6. toneDuration = 420;
  7. } else if (currentStep<=13) {
  8. toneDuration = 320;
  9. } else {
  10. toneDuration = 220;
  11. }
  12.  
  13. // Play back sequence up to current step
  14. for (int i=0; i<currentStep; i++) {
  15. delay(50);
  16. indicateButton(simonSequence[i], toneDuration);
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement