From d98eafb11a2a7c7943710d7e8467fcb3ee82740c Mon Sep 17 00:00:00 2001 From: Morgan Redfield Date: Sun, 3 Jul 2016 14:18:02 -0700 Subject: [PATCH 1/3] fix devAddr bug --- HamShield.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HamShield.cpp b/HamShield.cpp index 543fed9..c51badf 100644 --- a/HamShield.cpp +++ b/HamShield.cpp @@ -137,7 +137,7 @@ HamShield::HamShield() { HamShield::HamShield(uint8_t cs_pin) { devAddr = cs_pin; - pinMode(A1, OUTPUT); + pinMode(devAddr, OUTPUT); digitalWrite(A1, HIGH); pinMode(A4, OUTPUT); pinMode(A5, OUTPUT); From 2907eaf02e14995eed65f95c2e3907495785ebc5 Mon Sep 17 00:00:00 2001 From: nick6x Date: Wed, 10 Aug 2016 17:30:43 -0700 Subject: [PATCH 2/3] add comments, update library to Arduino 1.5 standard --- .../AFSK-PacketTester/AFSK-PacketTester.ino | 18 ++++++++++----- .../AFSK-SerialMessenger.ino | 20 ++++++++++++----- examples/DDS/DDS.ino | 13 +++++++++-- examples/FMBeacon/FMBeacon.ino | 22 +++++++++++++------ .../{ => FixMe}/Identifier/Identifier.ino | 0 examples/FoxHunt/FoxHunt.ino | 11 +++++++++- examples/FunctionalTest/FunctionalTest.ino | 14 +++++++++++- examples/HandyTalkie/HandyTalkie.ino | 19 ++++++++++++++-- examples/KISS/KISS.ino | 11 ++++++++++ examples/PSK31Transmit/PSK31Transmit.ino | 12 ++++++++++ examples/QPSK63Transmit/QPSK63Transmit.ino | 13 ++++++++++- examples/SSTV/SSTV.ino | 14 ++++++++---- examples/SSTV_M1_Static/SSTV_M1_Static.ino | 12 ++++++++++ .../SerialTransceiver/SerialTransceiver.ino | 15 +++++++++---- LICENSE => extras/LICENSE | 0 library.properties | 10 +++++++++ AFSK.cpp => src/AFSK.cpp | 0 AFSK.h => src/AFSK.h | 0 DDS.cpp => src/DDS.cpp | 0 DDS.h => src/DDS.h | 0 HamShield.cpp => src/HamShield.cpp | 0 HamShield.h => src/HamShield.h | 0 .../HamShield_comms.cpp | 0 HamShield_comms.h => src/HamShield_comms.h | 0 KISS.cpp => src/KISS.cpp | 0 KISS.h => src/KISS.h | 0 SimpleFIFO.h => src/SimpleFIFO.h | 0 27 files changed, 170 insertions(+), 34 deletions(-) rename examples/{ => FixMe}/Identifier/Identifier.ino (100%) mode change 100755 => 100644 rename LICENSE => extras/LICENSE (100%) create mode 100644 library.properties rename AFSK.cpp => src/AFSK.cpp (100%) rename AFSK.h => src/AFSK.h (100%) rename DDS.cpp => src/DDS.cpp (100%) rename DDS.h => src/DDS.h (100%) rename HamShield.cpp => src/HamShield.cpp (100%) rename HamShield.h => src/HamShield.h (100%) rename HamShield_comms.cpp => src/HamShield_comms.cpp (100%) rename HamShield_comms.h => src/HamShield_comms.h (100%) rename KISS.cpp => src/KISS.cpp (100%) rename KISS.h => src/KISS.h (100%) rename SimpleFIFO.h => src/SimpleFIFO.h (100%) diff --git a/examples/AFSK-PacketTester/AFSK-PacketTester.ino b/examples/AFSK-PacketTester/AFSK-PacketTester.ino index 47d9bf6..110a2ca 100644 --- a/examples/AFSK-PacketTester/AFSK-PacketTester.ino +++ b/examples/AFSK-PacketTester/AFSK-PacketTester.ino @@ -1,8 +1,14 @@ -/* Serial glue to send messages over APRS - * - * To do: add message receive code - * - */ +/* Hamshield + * Example: AFSK Packet Tester + * This example sends AFSK test data. You will need a seperate + * AFSK receiver to test the output of this example. + * Connect the HamShield to your Arduino. Screw the antenna + * into the HamShield RF jack. Connect the Arduino to wall + * power and then to your computer via USB. After uploading + * this program to your adruino, open the Serial Monitor to + * monitor the process of the HamShield. Check for output on + * AFSK receiver. +*/ #define DDS_REFCLK_DEFAULT 9600 @@ -34,7 +40,7 @@ void setup() { // turn on pwr to the radio digitalWrite(RESET_PIN, HIGH); - Serial.begin(115200); + Serial.begin(9600); radio.initialize(); radio.frequency(144390); diff --git a/examples/AFSK-SerialMessenger/AFSK-SerialMessenger.ino b/examples/AFSK-SerialMessenger/AFSK-SerialMessenger.ino index ba986da..96434bc 100644 --- a/examples/AFSK-SerialMessenger/AFSK-SerialMessenger.ino +++ b/examples/AFSK-SerialMessenger/AFSK-SerialMessenger.ino @@ -1,8 +1,16 @@ -/* Serial glue to send messages over APRS - * - * To do: add message receive code - * - */ +/* Hamshield + * Example: AFSK Serial Messenger + * Serial glue to send messages over APRS. You will need a + * seperate AFSK receiver to test the output of this example. + * Connect the HamShield to your Arduino. Screw the antenna + * into the HamShield RF jack. After uploading this program + * to your adruino, open the Serial Monitor to monitor. Type + * a message under 254 characters into the bar at the top of + * the monitor. Click the "Send" button. Check for output on + * AFSK receiver. + + * NOTE: add message receive code +*/ #define DDS_REFCLK_DEFAULT 9600 @@ -35,7 +43,7 @@ void setup() { // turn on the radio digitalWrite(RESET_PIN, HIGH); - Serial.begin(115200); + Serial.begin(9600); radio.initialize(); radio.frequency(145570); diff --git a/examples/DDS/DDS.ino b/examples/DDS/DDS.ino index cd6146f..9352a4d 100644 --- a/examples/DDS/DDS.ino +++ b/examples/DDS/DDS.ino @@ -1,5 +1,14 @@ -// Example sketch to show how to transmit arbitrary tones. -// In this case, the sketch alternates between 1200Hz and 2200Hz at 1s intervals. +/* Hamshield + * Example: DDS + * This is a simple example to show hot to transmit arbitrary + * tones. In this case, the sketh alternates between 1200Hz + * and 2200Hz at 1s intervals. + * Connect the HamShield to your Arduino. Screw the antenna + * into the HamShield RF jack. Connect the Arduino to wall + * power and then to your computer via USB. Upload this program + * to your Arduino. To test, set a HandyTalkie to 438MHz. You + * should hear two alternating tones. +*/ #define DDS_REFCLK_DEFAULT 9600 #include diff --git a/examples/FMBeacon/FMBeacon.ino b/examples/FMBeacon/FMBeacon.ino index 0398d48..07679f8 100644 --- a/examples/FMBeacon/FMBeacon.ino +++ b/examples/FMBeacon/FMBeacon.ino @@ -1,11 +1,19 @@ -/* -Morse Code Beacon +/* Hamshield + * Example: Morse Code Beacon + * Test beacon will transmit and wait 30 seconds. + * Beacon will check to see if the channel is clear before it + * will transmit. + * Connect the HamShield to your Arduino. Screw the antenna + * into the HamShield RF jack. Connect the Arduino to wall + * power and then to your computer via USB. After uploading + * this program to your adruino, open the Serial Monitor to + * monitor the status of the beacon. To test, set a HandyTalkie + * to 438MHz. You should hear the message " KC7IBT ARDUINO + * HAMSHIELD" in morse code. -Test beacon will transmit and wait 30 seconds. -Beacon will check to see if the channel is clear before it will transmit. - -TO-DO: Radio chip audio AGC too slow in responding to tones, worked around by playing a 6khz tone between actual dits/dahs. -Should work on adjusting AGC to not require this. + * NOTE: Radio chip audio AGC too slow in responding to tones, + * worked around by playing a 6khz tone between actual dits/dahs. + * Should work on adjusting AGC to not require this. */ #define DDS_REFCLK_DEFAULT 9600 diff --git a/examples/Identifier/Identifier.ino b/examples/FixMe/Identifier/Identifier.ino old mode 100755 new mode 100644 similarity index 100% rename from examples/Identifier/Identifier.ino rename to examples/FixMe/Identifier/Identifier.ino diff --git a/examples/FoxHunt/FoxHunt.ino b/examples/FoxHunt/FoxHunt.ino index 83d3d01..b07ac23 100755 --- a/examples/FoxHunt/FoxHunt.ino +++ b/examples/FoxHunt/FoxHunt.ino @@ -1,4 +1,13 @@ -/* Fox Hunt */ +/* Hamshield + * Example: Fox Hunt + * Plays a one minute tone at 10-13 minute intervals. Script + * will check to see if the channel is clear before it will + * transmit. + * Connect the HamShield to your Arduino. Screw the antenna + * into the HamShield RF jack. Connect the Arduino to wall power and then + * to your computer via USB. To test, set a HandyTalkie + * to 438MHz. You should hear a one-minute tone every 10-13 minutes. +*/ #include diff --git a/examples/FunctionalTest/FunctionalTest.ino b/examples/FunctionalTest/FunctionalTest.ino index 053dc12..e3cd51b 100644 --- a/examples/FunctionalTest/FunctionalTest.ino +++ b/examples/FunctionalTest/FunctionalTest.ino @@ -1,4 +1,16 @@ -/* HamShield Functional Test */ +/* Hamshield + * Example: Functional Test + * This is a simple example to demonstrate HamShield receive + * and transmit functionality. + * Connect the HamShield to your Arduino. Screw the antenna + * into the HamShield RF jack. Plug a pair of headphones into + * the HamShield. Connect the Arduino to wall power and then + * to your computer via USB. After uploading this program to + * your adruino, open the Serial Monitor. Serial Monitor will + * describe what you should be expecting to hear from your + * headphones. Tune a HandytTalkie to 446MHz to hear morse + * code example. +*/ #include diff --git a/examples/HandyTalkie/HandyTalkie.ino b/examples/HandyTalkie/HandyTalkie.ino index cf19162..e6d2eb5 100644 --- a/examples/HandyTalkie/HandyTalkie.ino +++ b/examples/HandyTalkie/HandyTalkie.ino @@ -1,5 +1,20 @@ -// Hamshield - +/* Hamshield + * Example: HandyTalkie + * This is a simple example to demonstrate HamShield receive + * and transmit functionality. + * Connect the HamShield to your Arduino. Screw the antenna + * into the HamShield RF jack. Plug a pair of headphones into + * the HamShield. Connect the Arduino to wall power and then + * to your computer via USB. After uploading this program to + * your adruino, open the Serial Monitor. Press the button on + * the HamShield to begin setup. After setup is complete, type + * your desired Tx/Rx frequency, in hertz, into the bar at the + * top of the Serial Monitor and click the "Send" button. + * To test with another HandyTalkie (HT), key up on your HT + * and make sure you can hear it through the headphones + * attached to the HamShield. Key up on the HamShield by + * holding the button. +*/ #include // create object for radio diff --git a/examples/KISS/KISS.ino b/examples/KISS/KISS.ino index e287b0d..16d7d64 100644 --- a/examples/KISS/KISS.ino +++ b/examples/KISS/KISS.ino @@ -1,3 +1,14 @@ +/* Hamshield + * Example: KISS + * This is a example configures the HamShield to be used as + * a TNC/KISS device. You will need a KISS device to input + * commands to the HamShield + * Connect the HamShield to your Arduino. Screw the antenna + * into the HamShield RF jack. Connect the Arduino to wall + * power and then to your computer via USB. Issue commands + * via the KISS equipment. +*/ + #include #include diff --git a/examples/PSK31Transmit/PSK31Transmit.ino b/examples/PSK31Transmit/PSK31Transmit.ino index 02bcad8..a4bb331 100644 --- a/examples/PSK31Transmit/PSK31Transmit.ino +++ b/examples/PSK31Transmit/PSK31Transmit.ino @@ -1,3 +1,15 @@ +/* Hamshield + * Example: PSK31Transmit + * This is a simple example to demonstrate HamShield PSK31 + * transmit functionality. + * Connect the HamShield to your Arduino. Screw the antenna + * into the HamShield RF jack. Connect the Arduino to wall + * power and then to your computer via USB. After uploading + * this program to your adruino, tune a PSK31 receiver and + * wait to receive the message "Why hello there, friend. + * Nice to meet you. Welcome to PSK31. 73, VE6SLP sk" +*/ + #include #include "varicode.h" diff --git a/examples/QPSK63Transmit/QPSK63Transmit.ino b/examples/QPSK63Transmit/QPSK63Transmit.ino index 2b23909..d97e146 100644 --- a/examples/QPSK63Transmit/QPSK63Transmit.ino +++ b/examples/QPSK63Transmit/QPSK63Transmit.ino @@ -1,3 +1,14 @@ +/* Hamshield + * Example: QPSK63Transmit + * This is a simple example to demonstrate HamShield QPSK63 + * transmit functionality. + * Connect the HamShield to your Arduino. Screw the antenna + * into the HamShield RF jack. Connect the Arduino to wall + * power and then to your computer via USB. After uploading + * this program to your adruino, tune a QPSK63 receiver and + * wait to receive the message "Why hello there, friend. + * Nice to meet you. Welcome to QPSK63. 73, VE6SLP sk" +*/ #include #include "varicode.h" @@ -46,7 +57,7 @@ void sendChar(uint8_t c) { //PORTD &= ~_BV(2); // Diagnostic pin (D2) } -char *string = "Why hello there, friend. Nice to meet you. Welcome to PSK31. 73, VE6SLP sk\r\n"; +char *string = "Why hello there, friend. Nice to meet you. Welcome to QPSK63. 73, VE6SLP sk\r\n"; void loop() { int i; // put your main code here, to run repeatedly: diff --git a/examples/SSTV/SSTV.ino b/examples/SSTV/SSTV.ino index 8cda5c3..44ec29e 100755 --- a/examples/SSTV/SSTV.ino +++ b/examples/SSTV/SSTV.ino @@ -1,7 +1,13 @@ -/* - -Sends an SSTV test pattern - +/* Hamshield + * Example: SSTV + * This program will transmit a test pattern. You will need + * SSTV receive equipment to test the output. + * Connect the HamShield to your Arduino. Screw the antenna + * into the HamShield RF jack. Connect the Arduino to wall + * power and then to your computer via USB. After uploading + * this program to your adruino, open the Serial Monitor to + * view the status of the program. Tune your SSTV to + * 446MHz to receive the image output. */ #define PWM_PIN 3 diff --git a/examples/SSTV_M1_Static/SSTV_M1_Static.ino b/examples/SSTV_M1_Static/SSTV_M1_Static.ino index 1618b7b..410b810 100644 --- a/examples/SSTV_M1_Static/SSTV_M1_Static.ino +++ b/examples/SSTV_M1_Static/SSTV_M1_Static.ino @@ -1,3 +1,15 @@ +/* Hamshield + * Example: SSTV M1 Static + * This program will transmit a static image. You will need + * SSTV receive equipment to test the output. + * Connect the HamShield to your Arduino. Screw the antenna + * into the HamShield RF jack. Connect the Arduino to wall + * power and then to your computer via USB. After uploading + * this program to your adruino, open the Serial Monitor to + * view the status of the program. Tune your SSTV to + * 145.5MHz to receive the image output. +*/ + // So the precalculated values will get stored #define DDS_REFCLK_DEFAULT (34965/2) diff --git a/examples/SerialTransceiver/SerialTransceiver.ino b/examples/SerialTransceiver/SerialTransceiver.ino index 530dbee..0f0a0a0 100644 --- a/examples/SerialTransceiver/SerialTransceiver.ino +++ b/examples/SerialTransceiver/SerialTransceiver.ino @@ -1,6 +1,13 @@ -/* - -SerialTransceiver is TTL Serial port "glue" to allow desktop or laptop control of the HamShield +/* Hamshield + * Example: Serial Tranceiver + * SerialTransceiver is TTL Serial port "glue" to allow + * desktop or laptop control of the HamShield. + * Connect the HamShield to your Arduino. Screw the antenna + * into the HamShield RF jack. Plug a pair of headphones into + * the HamShield. Connect the Arduino to wall power and then + * to your computer via USB. After uploading this program to + * your adruino, open the Serial Monitor. Use the bar at the + * top of the serial monitor to enter commands as seen below. Commands: @@ -82,7 +89,7 @@ void setup() { pinMode(RESET_PIN, OUTPUT); digitalWrite(RESET_PIN, HIGH); - Serial.begin(115200); + Serial.begin(9600); Serial.print(";;;;;;;;;;;;;;;;;;;;;;;;;;"); int result = radio.testConnection(); diff --git a/LICENSE b/extras/LICENSE similarity index 100% rename from LICENSE rename to extras/LICENSE diff --git a/library.properties b/library.properties new file mode 100644 index 0000000..e0de09b --- /dev/null +++ b/library.properties @@ -0,0 +1,10 @@ +name=HamShield +version=1.0.2 +author=Morgan Redfield , Casey Halverson +maintainer=Morgan Redfield +sentence=A library for use with HamShield by Enhanced Radio Devices. +paragraph= +category=Device Control +url=http://www.hamshield.com +architectures=* +includes=HamShield.h \ No newline at end of file diff --git a/AFSK.cpp b/src/AFSK.cpp similarity index 100% rename from AFSK.cpp rename to src/AFSK.cpp diff --git a/AFSK.h b/src/AFSK.h similarity index 100% rename from AFSK.h rename to src/AFSK.h diff --git a/DDS.cpp b/src/DDS.cpp similarity index 100% rename from DDS.cpp rename to src/DDS.cpp diff --git a/DDS.h b/src/DDS.h similarity index 100% rename from DDS.h rename to src/DDS.h diff --git a/HamShield.cpp b/src/HamShield.cpp similarity index 100% rename from HamShield.cpp rename to src/HamShield.cpp diff --git a/HamShield.h b/src/HamShield.h similarity index 100% rename from HamShield.h rename to src/HamShield.h diff --git a/HamShield_comms.cpp b/src/HamShield_comms.cpp similarity index 100% rename from HamShield_comms.cpp rename to src/HamShield_comms.cpp diff --git a/HamShield_comms.h b/src/HamShield_comms.h similarity index 100% rename from HamShield_comms.h rename to src/HamShield_comms.h diff --git a/KISS.cpp b/src/KISS.cpp similarity index 100% rename from KISS.cpp rename to src/KISS.cpp diff --git a/KISS.h b/src/KISS.h similarity index 100% rename from KISS.h rename to src/KISS.h diff --git a/SimpleFIFO.h b/src/SimpleFIFO.h similarity index 100% rename from SimpleFIFO.h rename to src/SimpleFIFO.h From 06cb3f24eddaa391e0160e99d884602e132bd957 Mon Sep 17 00:00:00 2001 From: nick6x Date: Thu, 11 Aug 2016 20:01:02 -0700 Subject: [PATCH 3/3] Resolve compiling issues in Examples. --- examples/AX25Receive/AX25Receive.ino | 3 --- examples/CrystalCalibration/CrystalCalibration.ino | 2 +- examples/Gauges/Gauges.ino | 2 +- examples/JustTransmit/JustTransmit.ino | 2 +- examples/Parrot/Parrot.ino | 2 +- examples/SSTV/SSTV.ino | 2 +- 6 files changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/AX25Receive/AX25Receive.ino b/examples/AX25Receive/AX25Receive.ino index 7b9cc76..a2ac961 100644 --- a/examples/AX25Receive/AX25Receive.ino +++ b/examples/AX25Receive/AX25Receive.ino @@ -29,7 +29,6 @@ void setup() { radio.initialize(); radio.frequency(145010); radio.setSQOff(); - I2Cdev::writeWord(A1846S_DEV_ADDR_SENLOW, 0x44, 0b11111111); Serial.println(F("Frequency")); delay(100); Serial.print(F("Squelch(H/L): ")); @@ -37,8 +36,6 @@ void setup() { Serial.print(F(" / ")); Serial.println(radio.getSQLoThresh()); radio.setModeReceive(); - Serial.print(F("RX? ")); - Serial.println(radio.getRX()); Serial.println(F("DDS Start")); delay(100); dds.start(); diff --git a/examples/CrystalCalibration/CrystalCalibration.ino b/examples/CrystalCalibration/CrystalCalibration.ino index 175d5f5..0b9ce48 100644 --- a/examples/CrystalCalibration/CrystalCalibration.ino +++ b/examples/CrystalCalibration/CrystalCalibration.ino @@ -28,7 +28,7 @@ void setup() { radio.initialize(); radio.setRfPower(0); - radio.setFrequency(145050); + radio.frequency(145050); dds.start(); dds.setFrequency(1200); diff --git a/examples/Gauges/Gauges.ino b/examples/Gauges/Gauges.ino index 5226796..e288445 100755 --- a/examples/Gauges/Gauges.ino +++ b/examples/Gauges/Gauges.ino @@ -41,7 +41,7 @@ void setup() { int result = radio.testConnection(); Serial.println(result,DEC); radio.initialize(); - radio.setFrequency(446000); + radio.frequency(446000); radio.setModeReceive(); Serial.println("Entering gauges..."); tone(9,1000); diff --git a/examples/JustTransmit/JustTransmit.ino b/examples/JustTransmit/JustTransmit.ino index fd2c1af..a2d2dbe 100644 --- a/examples/JustTransmit/JustTransmit.ino +++ b/examples/JustTransmit/JustTransmit.ino @@ -28,7 +28,7 @@ void setup() { Serial.println("Setting radio to its defaults.."); radio.initialize(); radio.setRfPower(0); - radio.setChanMode(3); + //radio.setChanMode(3); } void loop() { diff --git a/examples/Parrot/Parrot.ino b/examples/Parrot/Parrot.ino index abbbc3e..67a210d 100755 --- a/examples/Parrot/Parrot.ino +++ b/examples/Parrot/Parrot.ino @@ -37,7 +37,7 @@ void setup() { // int result = radio.testConnection(); radio.initialize(); - radio.setFrequency(446000); + radio.frequency(446000); setPwmFrequency(9, 1); } diff --git a/examples/SSTV/SSTV.ino b/examples/SSTV/SSTV.ino index 44ec29e..e28e81c 100755 --- a/examples/SSTV/SSTV.ino +++ b/examples/SSTV/SSTV.ino @@ -51,7 +51,7 @@ void setup() { void loop() { - if(radio.waitForChannel(1000,2000)) { // Wait forever for calling frequency to open, then wait 2 seconds for breakers + if(radio.waitForChannel(1000,2000, rssi)) { // Wait forever for calling frequency to open, then wait 2 seconds for breakers radio.setModeTransmit(); // Turn on the transmitter delay(250); // Wait a moment radio.SSTVTestPattern(MARTIN1); // send a MARTIN1 test pattern