REM PTCBeaconController REM This program sends appropriate instructions to the PTC-IIpro controller from SCS (http://www.scs-ptc.com), REM so that it works as a beacon, similar to the beacon project from Northern California DX Foundation, except REM it is not synchronous. REM Copyright (C) 2008 Otavio Luiz Bottecchia REM Mail address: UFU/IQUFU Avenida João Naves de Avila 2160 REM 38408-408 Uberlandia, MG Brazil. REM This program is free software: you can redistribute it and/or modify REM it under the terms of the GNU General Public License as published by REM the Free Software Foundation, either version 3 of the License or any later version. REM REM This program is distributed in the hope that it will be useful, REM but WITHOUT ANY WARRANTY; without even the implied warranty of REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the REM GNU General Public License for more details. REM You should have received a copy of the GNU General Public License REM along with this program. If not, see . REM This program is intended to use with a transceiver and you must know and obey the regulations in REM your country before you transmit. REM The freedom to use this program does not mean you are free to use radiofrequency. REM US users are subject to FCC regulations (http://www.fcc.gov). REM Brazilian users are subjected to Anatel regulations (http://www.anatel.gov.br). REM Please check band plan of your area before you choose the frequencies for the beacon REM and modify the values used here as appropriate. REM IF YOU AGREE WITH THE LICENSE TERMS (see license.txt file), REM THEN CHANGE THE PARAMETER "License%" from 0 to 1. License%=0 REM Change here if you agree with the license terms. IF License%=0 THEN PRINT "Please change parameter License% if you agree with license terms" : END PRINT " PTCBeaconController Copyright (C) 2008 Otavio Luiz Bottecchia":PRINT PRINT " This program comes with ABSOLUTELY NO WARRANTY; for details see license.txt file" PRINT " or se see http://www.gnu.org/licenses/" PRINT " This is free software, and you are welcome to redistribute it":PRINT:PRINT REM Abrir porta de comunicação com o PTC REM Baud rate do PTC é diferente da baud rate do transceptor. porta%=OPENUP "COM3: baud=38400 parity=N data=8 stop=1" IF porta%=0 THEN PRINT "ERRO EM COM3!!!":END PRINT "Iniciando o programa de Emissão Piloto..." DATA 200,400,800,1600 REM: tempo de espera em decisegundos READ tShort%, tMedium%, tLong%, tBeacon% BeaconText$="" REM: Put here your callsign as the text to be beaconed IF BeaconText$="" THEN PRINT "You forgot to insert your callsign in BeaconText$":END crlf$=CHR$(13)+CHR$(10) BPUT#porta%,CHR$(13) :REM Manda um carriage return para inicializar o SCS-PTC WAIT 500 PROC_aoPTC(CHR$(27)+"DD",tMedium%) PROC_aoPTC("STATUS 2",tShort%) PROC_aoPTC("TRX TYPE YAESU 4800",tShort%) REM: FT100D tem baud rate=4800 PROC_aoPTC("TRX YTYPE 3", tShort%) REM: 3 é FT100, 6 é FT817 PROC_aoPTC("CWSpeed 100",tShort%) REM: Velocidade em caracters por minuto PROC_aoPTC("CWMoni 0", tShort%) REM: (1) Eco no PTC ligado, (0) Eco desligado REPEAT PROC_aoPTC("TRX F 10149.5",tMedium%) PROC_aoPTC("CWTerm", tShort%) REM PROC_aoPTC("E",tShort%) REM: Permitir o AT100-Pro se reajustar. PROC_aoPTC(BeaconText$,tBeacon%) PROC_aoPTC(CHR$(27)+"Q",tMedium%) PROC_aoPTC("TRX F 14105.5",tMedium%) PROC_aoPTC("CWTerm", tShort%) REM PROC_aoPTC("E",tShort%) PROC_aoPTC(BeaconText$, tBeacon%) PROC_aoPTC(CHR$(27)+"Q", tMedium%) PROC_aoPTC("TRX F 18115.5",tMedium%) PROC_aoPTC("CWTerm", tShort%) REM PROC_aoPTC("E",tShort%) PROC_aoPTC(BeaconText$, tBeacon%) PROC_aoPTC(CHR$(27)+"Q", tMedium%) PROC_aoPTC("TRX F 21155.5",tMedium%) PROC_aoPTC("CWTerm",tShort%) REM PROC_aoPTC("E",tShort%) PROC_aoPTC(BeaconText$, tBeacon%) PROC_aoPTC(CHR$(27)+"Q",tMedium%) PROC_aoPTC("TRX F 24935.5",tMedium%) PROC_aoPTC("CWTerm",tShort%) REM PROC_aoPTC("E",tShort%) PROC_aoPTC(BeaconText$, tBeacon%) PROC_aoPTC(CHR$(27)+"Q",tMedium%) PROC_aoPTC("TRX F 28205.5",tMedium%) PROC_aoPTC("CWTerm",tShort%) REM PROC_aoPTC("E",tShort%) PROC_aoPTC(BeaconText$, tBeacon%) PROC_aoPTC(CHR$(27)+"Q",tMedium%) WAIT 2*tLong% UNTIL FALSE PRINT "O programa terminou normalmente." END DEF PROC_aoPTC(comando$, aguardar%) PRINT#porta%, CHR$(30) :REM solicita status PROC_ouvePTC PRINT "Enviando:"comando$ PRINT#porta%, comando$+CHR$(13) :REM envia o cmd mais "carriage return" WAIT aguardar% :REM Aguarar. PROC_ouvePTC PRINT PRINT#porta%, CHR$(30) ENDPROC DEF PROC_leTeclado INPUT comando$ IF LEFT$(comando$,1)="." THEN comando$=CHR$(27)+MID$(comando$,2,LEN(comando$)) ENDIF ENDPROC DEF PROC_ouvePTC tamanho% = EXT#porta% IF tamanho% > 0 THEN primeiro_byte% = BGET#porta% IF primeiro_byte% = 30 THEN PRINT "STATUS:";" "; data% = BGET#porta% PRINT data%;","; FOR i% = 3 TO tamanho% data% = BGET#porta% PRINT CHR$(data%); NEXT ELSE PRINT CHR$(primeiro_byte%); FOR i% = 2 TO tamanho% data% = BGET#porta% PRINT CHR$(data%); NEXT ENDIF PRINT ENDIF ENDPROC