Show Hosts
Topics
Links
Sponsors
After Show Net
857D Heads Up Code #include <SoftwareSerial.h> #include “FT857D.h” the file FT857D.h has a lot of documentation which I've added to make using the library easier const int dispPin = 6; int dly = 250; String strMode = “Mode: ”; String strFreq = “Freq: ”; FT857D catDevice; define “catDevice” so that we may pass CAT commands SoftwareSerial lcdDisplay = SoftwareSerial(255, dispPin);
void setup() {
pinMode(dispPin, OUTPUT); digitalWrite(dispPin, HIGH); lcdDisplay.begin(9600); delay(100); lcdDisplay.write(12); // Clear lcdDisplay.write(17); // Turn backlight on delay(5); // Required delay lcdDisplay.print("Connecting at"); // First line lcdDisplay.write(13); // Form feed lcdDisplay.print("4800 Baud!"); // Second line delay(3000); // Wait 3 seconds lcdDisplay.write(12); catDevice.begin(4800); // Start listening to the radio
}
void loop() {
delay(dly); lcdDisplay.print(strFreq + catDevice.getFreqMode());
lcdDisplay.write(13);
byte mode = catDevice.getMode(); String textMode; switch(mode) { case CAT_MODE_FM: textMode = "FM"; break; case CAT_MODE_LSB: textMode = "LSB"; break; case CAT_MODE_USB: textMode = "USB"; break; case CAT_MODE_CW: textMode = "CW"; break; case CAT_MODE_AM: textMode = "AM"; break; case CAT_MODE_CWR: textMode = "CWR"; break; case CAT_MODE_DIG: textMode = "DIG"; break; case CAT_MODE_PKT: textMode = "PKT"; break; case CAT_MODE_FMN: default: textMode = "UNKNOWN"; }
lcdDisplay.print(strMode + textMode);
lcdDisplay.write(13);
}