send callsign each time mode is changed, cw frequency correct

pico-v0.12
alanbjohnston 3 years ago committed by GitHub
parent 6625d81de1
commit 967f2795e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -57,6 +57,7 @@ WiFiClient client;
//#define PICO_W // define if Pico W board. Otherwise, compilation fail for Pico or runtime fail if compile as Pico W
byte green_led_counter = 0;
char call[] = "AMSAT"; // put your callsign here
void setup() {
@ -131,11 +132,9 @@ void setup() {
/**/
Serial.println("Transmitting callsign");
char call[] = "AMSAT";
strcpy(callsign, call);
strcpy(callsign, call);
transmit_callsign(callsign);
sleep(5.0);
sleep(5.0);
/**/
sampleTime = (unsigned int) millis();
@ -203,6 +202,9 @@ void loop() {
if (mode != new_mode) {
Serial.println("Changing mode");
mode = new_mode; // change modes if button pressed
transmit_callsign(callsign);
sleep(0.5);
config_telem();
config_radio();
}
@ -3417,7 +3419,7 @@ void configure_wifi() {
void transmit_cw(int freq, float duration) { // freq in Hz, duration in milliseconds
unsigned long start = micros();
unsigned long duration_us = duration * 1000;
float period_us = (1.0E6) / (float)(freq);
float period_us = (0.5E6) / (float)(freq);
bool phase = HIGH;
while((micros() - start) < duration_us) {
digitalWrite(AUDIO_OUT_PIN, phase); // ToDo: if no TXC, just turn on PWM carrier

Loading…
Cancel
Save

Powered by TurnKey Linux.