From c3a88e2c16b9787b0d1abfeb8b82d1c1846d7064 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 5 Jul 2022 13:29:41 -0400 Subject: [PATCH] Update cubesatsim.ino --- cubesatsim/cubesatsim.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 602054ce..d2463220 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -2044,7 +2044,7 @@ void pwm_interrupt_handler() { // if (random(0,2) == 1) // pwm_rnd_bit *= (-1.0); - pwm_rnd_bit = (buffer[wave_position] > 0) ? 1 : 0; + pwm_rnd_bit = (buffer[wav_position] > 0) ? 1 : 0; if ((pwm_value == (128 - pwm_amplitude)) && (pwm_rnd_bit == 1)) { pwm_value = 128 + pwm_amplitude; @@ -2057,6 +2057,6 @@ void pwm_interrupt_handler() { } pwm_set_gpio_level(AUDIO_OUT_PIN, pwm_value); if (wav_position++ > 950) - wave_position = 0; + wav_position = 0; }