kopia lustrzana https://github.com/eleccoder/raspi-pico-aprs-tnc
PTT control added to the 'beacon' demo
rodzic
0658e99721
commit
f0fc245cf4
|
@ -41,6 +41,8 @@ The line-out voltage can be as high as 2.7 V<sub>pp</sub> (~1 V<sub>rms</sub>) (
|
|||
|
||||
## Build the library and the 'beacon' demo application
|
||||
|
||||
NOTE: In case you want to allow the Pico to control the PTT (*Push-To-Talk*) input of your transmitter, set the appropriate `#define` parameters in `src/aprs_pico_beacon_demo.c`.
|
||||
|
||||
```
|
||||
git clone https://github.com/eleccoder/raspi-pico-aprs-tnc.git
|
||||
cd raspi-pico-aprs-tnc
|
||||
|
@ -52,7 +54,9 @@ cmake --build build
|
|||
|
||||
## Run the 'beacon' demo application
|
||||
|
||||
The analog AFSK audio signal will be available at the filter's line-out. You can probe it by a scope, listen to it by using an audio amp, or connect it to any RF transceiver to send it on the air (ham radio license required). But for testing the signal integrity, you can feed the signal into the soundcard of your computer and let decode its data content by [Dire Wolf](https://github.com/wb2osz/direwolf) - see down below.
|
||||
The analog AFSK audio signal will be available at the filter's line-out. You can probe it by a scope, listen to it by using an audio amp, or connect it to any RF transceiver to send it on the air (ham radio license required).
|
||||
|
||||
But for testing the signal integrity, you can feed the signal into the soundcard of your computer and let decode its data content by [Dire Wolf](https://github.com/wb2osz/direwolf) - see down below.
|
||||
|
||||
### Flash the Pico
|
||||
|
||||
|
@ -60,7 +64,7 @@ The analog AFSK audio signal will be available at the filter's line-out. You can
|
|||
cd build
|
||||
```
|
||||
|
||||
Flash 'aprs_pico_beacon_demo[.uf2|.elf|.bin|.hex]' to the Pico board as you're usually doing.
|
||||
Flash `aprs_pico_beacon_demo[.uf2|.elf|.bin|.hex]` to the Pico board as you're usually doing.
|
||||
|
||||
|
||||
### Test the 'beacon' demo application using *Dire Wolf* (on LINUX)
|
||||
|
|
|
@ -16,23 +16,50 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
/* This program demonstrates the usage of the 'libaprs_pico.a' library by showing
|
||||
* how to send a static APRS beacon.
|
||||
*
|
||||
* Optionally, PTT control can be enabled (see the #define section down below).
|
||||
*/
|
||||
|
||||
// Define whether/how the RPi Pico should control a transmitter's PTT input
|
||||
#define PTT_ENABLE (false)
|
||||
#define PTT_GPXX_PIN (1)
|
||||
#define PTT_DELAY_BEFORE_TX_IN_MSEC (400)
|
||||
#define PTT_TX_PERIOD_IN_MIN (10)
|
||||
|
||||
|
||||
#include "aprs_pico.h"
|
||||
#include "pico/stdlib.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
stdio_init_all();
|
||||
|
||||
#if PTT_ENABLE == true
|
||||
|
||||
gpio_init(PTT_GPXX_PIN);
|
||||
gpio_set_dir(PTT_GPXX_PIN, GPIO_OUT);
|
||||
|
||||
#endif // PTT_ENABLE
|
||||
|
||||
audio_buffer_pool_t* audio_buffer_pool = aprs_pico_init();
|
||||
|
||||
// Let the altitude run over time
|
||||
double alt_in_m = 0.0;
|
||||
|
||||
while (true) // Loop forever
|
||||
// Loop forever
|
||||
while (true)
|
||||
{
|
||||
#if PTT_ENABLE == true
|
||||
|
||||
gpio_put(PTT_GPXX_PIN, true);
|
||||
sleep_ms(PTT_DELAY_BEFORE_TX_IN_MSEC);
|
||||
|
||||
#endif // PTT_ENABLE
|
||||
|
||||
// Send an APRS test message
|
||||
aprs_pico_sendAPRS(audio_buffer_pool,
|
||||
"DL3TG-9", // Source call sign
|
||||
|
@ -42,13 +69,17 @@ int main()
|
|||
"APRS by RPi-Pico - https://github.com/eleccoder/raspi-pico-aprs-tnc", // Text message
|
||||
48.75588, // Latitude (in deg)
|
||||
9.19011, // Longitude (in deg)
|
||||
alt_in_m, // Altitude (in m)
|
||||
483, // Altitude (in m)
|
||||
'/', // APRS symbol table: Primary
|
||||
'>', // APRS symbol code: Car
|
||||
128u); // Volume (0 ... 256)
|
||||
|
||||
// Don't raise too high ...
|
||||
alt_in_m = (alt_in_m < 1000.0) ? alt_in_m + 100.0 : 0.0;
|
||||
#if PTT_ENABLE == true
|
||||
|
||||
gpio_put(PTT_GPXX_PIN, false);
|
||||
sleep_ms(PTT_TX_PERIOD_IN_MIN * 60 * 1000);
|
||||
|
||||
#endif // PTT_ENABLE
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Ładowanie…
Reference in New Issue