Update cubesatsim.ino

pull/153/head
alanbjohnston 4 years ago committed by GitHub
parent a37c79b92d
commit c3a88e2c16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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;
}

Loading…
Cancel
Save

Powered by TurnKey Linux.