Skip to content

Commit

Permalink
Merge pull request #75 from gpstar81/updates
Browse files Browse the repository at this point in the history
fixes
  • Loading branch information
gpstar81 authored Mar 19, 2023
2 parents c9325d9 + 002d953 commit ed086ed
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions source/proton_pack/proton_pack.ino
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ const int smoke_pin = 39;
* Enable or disable overall smoke settings.
* This can be toggled with a switch on PIN 37.
*/
boolean b_smoke_enabled = false;
boolean b_smoke_enabled = true;

/*
* Smoke for a second smoke machine or motor. I use this in the booster tube.
Expand Down Expand Up @@ -967,23 +967,21 @@ void checkSwitches() {
}

// Smoke
if(switch_smoke.getState() == HIGH) {
if(b_smoke_enabled == false) {
b_smoke_enabled = true;

w_trig.trackStop(S_VENT_SMOKE);
w_trig.trackGain(S_VENT_SMOKE, i_volume);
w_trig.trackPlayPoly(S_VENT_SMOKE);
}
}
else {
if(switch_smoke.isPressed() || switch_smoke.isReleased()) {
if(b_smoke_enabled == true) {
b_smoke_enabled = false;

w_trig.trackStop(S_VENT_DRY);
w_trig.trackGain(S_VENT_DRY, i_volume);
w_trig.trackPlayPoly(S_VENT_DRY);
}
else {
b_smoke_enabled = true;

w_trig.trackStop(S_VENT_SMOKE);
w_trig.trackGain(S_VENT_SMOKE, i_volume);
w_trig.trackPlayPoly(S_VENT_SMOKE);
}
}

// Vibration toggle switch.
Expand Down

0 comments on commit ed086ed

Please sign in to comment.