diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 20feedcc..4937ae06 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -2243,19 +2243,20 @@ void loop1() { // pwm_counter -= pwm_counter_max; pwm_rnd_bit = (buffer[wav_position] > 0) ? HIGH: LOW; + digitalWrite(AUDIO_OUT_PIN, pwm_rnd_bit); -/* - pwm_rnd_bit = (buffer[wav_position] > 0) ? 1 : 0; - if ((pwm_value == (128 - pwm_amplitude)) && (pwm_rnd_bit == 1)) { - pwm_value = 128 + pwm_amplitude; -// Serial.print("-"); +// pwm_rnd_bit = (buffer[wav_position] > 0) ? 1 : 0; + + if (pwm_rnd_bit == 1) { +// pwm_value = 128 + pwm_amplitude; + Serial.print("-"); } else { - pwm_value = 128 - pwm_amplitude; -// Serial.print("_"); +// pwm_value = 128 - pwm_amplitude; + Serial.print("_"); } - pwm_set_gpio_level(AUDIO_OUT_PIN, pwm_value); +// pwm_set_gpio_level(AUDIO_OUT_PIN, pwm_value); // Serial.println("wav_position: "); // Serial.println(wav_position); */