Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Blaster Deflection // BC attempt swing timer
- #if NUM_BUTTONS == 1
- // 1 button
- case EVENTID(BUTTON_POWER, EVENT_FIRST_SAVED_CLICK_SHORT, MODE_ON):
- case EVENTID(BUTTON_POWER, EVENT_SECOND_CLICK_SHORT, MODE_ON):
- case EVENTID(BUTTON_POWER, EVENT_THIRD_CLICK_SHORT, MODE_ON):
- #else
- // 2 and 3 button
- case EVENTID(BUTTON_AUX, EVENT_FIRST_SAVED_CLICK_SHORT, MODE_ON):
- case EVENTID(BUTTON_AUX, EVENT_SECOND_SAVED_CLICK_SHORT, MODE_ON):
- case EVENTID(BUTTON_AUX, EVENT_THIRD_CLICK_SHORT, MODE_ON): // single, double, or triple click all trigger blast and enter Multi-Blast mode
- #endif
- swing_blast_ = true;
- SaberBase::DoBlast();
- return true;
- time_t startTime; //mark the startTime
- do{ //time checking loop
- time_t currentTime; //get the current time
- if(currentTime - startTime >= 2){
- swing_blast_ = false;
- STDOUT.println("Exiting Multi-blast mode");
- break;
- } //if not...
- case EVENTID(BUTTON_NONE, EVENT_SWING, MODE_ON):
- if (swing_blast_) {
- SaberBase::DoBlast();
- return true;
- }
- } //stay in Multi-blast mode and check time again
- while (swing_blast_);
- return true;
Advertisement
Add Comment
Please, Sign In to add comment