Update cubesatsim.ino

pull/161/head
alanbjohnston 4 years ago committed by GitHub
parent 287faf8c78
commit d65476c580
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2367,19 +2367,19 @@ void setup1() {
} }
void loop1() { void loop1() {
Serial.print("l1 "); // Serial.print("l1 ");
Serial.print(wav_position); // Serial.print(wav_position);
Serial.print(" "); // Serial.print(" ");
if (mode == FSK) if (mode == FSK)
{ {
tx_bit = (buffer[wav_position] > 0) ? HIGH: LOW; tx_bit = (buffer[wav_position++] > 0) ? HIGH: LOW;
digitalWrite(AUDIO_OUT_PIN, tx_bit); digitalWrite(AUDIO_OUT_PIN, tx_bit);
} }
else if (mode == BPSK) { else if (mode == BPSK) {
tx_bit = (buffer[wav_position] > 0) ? true: false; tx_bit = (buffer[wav_position++] > 0) ? true: false;
pwm_config_set_output_polarity( &config, tx_bit, tx_bit); pwm_config_set_output_polarity( &config, tx_bit, tx_bit);
pwm_init(bpsk_pin_slice, &config, true); pwm_init(bpsk_pin_slice, &config, true);
@ -2388,7 +2388,7 @@ void loop1() {
// if (wav_position++ > BUFFER_SIZE) { // 300) { // if (wav_position++ > BUFFER_SIZE) { // 300) {
// wav_position = wav_position - BUFFER_SIZE; // wav_position = wav_position - BUFFER_SIZE;
if (wav_position++ > bufLen) { // 300) { if (wav_position > bufLen) { // 300) {
wav_position = wav_position - bufLen; wav_position = wav_position - bufLen;
Serial.print("R"); Serial.print("R");
Serial.print(" "); Serial.print(" ");

Loading…
Cancel
Save

Powered by TurnKey Linux.