Carrier detect LED written in C for speed.
This commit is contained in:
BIN
aprs_utils/carrier_detect/carrier_detect_led
Executable file
BIN
aprs_utils/carrier_detect/carrier_detect_led
Executable file
Binary file not shown.
22
aprs_utils/carrier_detect/carrier_detect_led.c
Normal file
22
aprs_utils/carrier_detect/carrier_detect_led.c
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#include <pigpio.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define DCD_LED 17
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
if (gpioInitialise() < 0)
|
||||||
|
{
|
||||||
|
// pigpio initialisation failed.
|
||||||
|
printf("pigpio failed");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// pigpio initialised okay.
|
||||||
|
gpioSetMode(DCD_LED, PI_OUTPUT); // Set DCD_LED as output
|
||||||
|
gpioWrite(DCD_LED, 1); // Set DCD_LED high
|
||||||
|
gpioSleep(PI_TIME_RELATIVE, 1, 0); // sleep for one second
|
||||||
|
gpioWrite(DCD_LED, 0); // Set DCD_LED low
|
||||||
|
gpioTerminate();
|
||||||
|
}
|
||||||
|
}
|
1
aprs_utils/carrier_detect/howto-compile.txt
Normal file
1
aprs_utils/carrier_detect/howto-compile.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
gcc -Wall -pthread -o prog dcd.c -lpigpio -lrt
|
BIN
aprs_utils/carrier_detect_led
Executable file
BIN
aprs_utils/carrier_detect_led
Executable file
Binary file not shown.
@@ -55,7 +55,7 @@ LAST_EPOCH_DATE="$(date -d"$CURRENT_DATE_TIME" +%s)"
|
|||||||
while read LINE
|
while read LINE
|
||||||
do
|
do
|
||||||
# Light up carrier detect
|
# Light up carrier detect
|
||||||
/home/marcel/ham/aprs_utils/carrier_detect_led.sh &
|
sudo /home/marcel/ham/aprs_utils/carrier_detect_led &
|
||||||
|
|
||||||
# Start filter for received messages to PE1RXF (all sufixes)
|
# Start filter for received messages to PE1RXF (all sufixes)
|
||||||
# Messages addressed to PE1RXF are stored in file /home/marcel/ham/aprs_utils/aprs_received_messages.log
|
# Messages addressed to PE1RXF are stored in file /home/marcel/ham/aprs_utils/aprs_received_messages.log
|
||||||
|
Reference in New Issue
Block a user