Skip to content

Commit

Permalink
fix bug with button1 on oscillator tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Nov 11, 2015
1 parent 110d115 commit dbafd4b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,27 @@ void loop() {

// middle button switch which source we hear from mixer1
if (button1.fallingEdge()) {
mixer1_setting = mixer1_setting + 1;
if (mixer1_setting == 0) {
mixer1.gain(0, 0.75);
mixer1.gain(1, 0.0);
mixer1.gain(2, 0.0);
mixer1.gain(3, 0.0);
Serial.println("Mixer1: Control oscillator");
mixer1_setting = 1;
} else if (mixer1_setting == 1) {
mixer1.gain(0, 0.0);
mixer1.gain(1, 0.75);
mixer1.gain(2, 0.0);
mixer1.gain(3, 0.0);
Serial.println("Mixer1: Frequency Modulated Oscillator");
mixer1_setting = 2;
} else if (mixer1_setting == 2) {
mixer1.gain(0, 0.0);
mixer1.gain(1, 0.0);
mixer1.gain(2, 0.75);
mixer1.gain(3, 0.0);
Serial.println("Mixer1: Regular Sine Wave Oscillator");
mixer1_setting = 3;
} else if (mixer1_setting == 3) {
mixer1.gain(0, 0.0);
mixer1.gain(1, 0.0);
Expand Down

0 comments on commit dbafd4b

Please sign in to comment.