2016-08-13 21:05:19 +00:00
|
|
|
/* 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.
|
|
|
|
*/
|
|
|
|
|
2015-07-14 00:55:07 +00:00
|
|
|
#include <HamShield.h>
|
|
|
|
#include <KISS.h>
|
2016-08-20 01:52:36 +00:00
|
|
|
#include <packet.h>
|
2015-07-14 00:55:07 +00:00
|
|
|
|
|
|
|
HamShield radio;
|
|
|
|
DDS dds;
|
|
|
|
KISS kiss(&Serial, &radio, &dds);
|
2016-08-17 21:17:56 +00:00
|
|
|
AFSK afsk;
|
2015-07-14 00:55:07 +00:00
|
|
|
|
2015-11-23 16:54:10 +00:00
|
|
|
#define PWM_PIN 3
|
|
|
|
#define RESET_PIN A3
|
|
|
|
#define SWITCH_PIN 2
|
|
|
|
|
2015-07-14 00:55:07 +00:00
|
|
|
void setup() {
|
2015-11-23 16:54:10 +00:00
|
|
|
// NOTE: if not using PWM out, it should be held low to avoid tx noise
|
|
|
|
pinMode(PWM_PIN, OUTPUT);
|
|
|
|
digitalWrite(PWM_PIN, LOW);
|
|
|
|
|
|
|
|
// prep the switch
|
|
|
|
pinMode(SWITCH_PIN, INPUT_PULLUP);
|
|
|
|
|
|
|
|
// set up the reset control pin
|
|
|
|
pinMode(RESET_PIN, OUTPUT);
|
|
|
|
digitalWrite(RESET_PIN, LOW);
|
2015-07-14 00:55:07 +00:00
|
|
|
|
|
|
|
Serial.begin(9600);
|
2015-11-23 16:54:10 +00:00
|
|
|
|
|
|
|
while (digitalRead(SWITCH_PIN));
|
|
|
|
|
|
|
|
// let the AU ot of reset
|
|
|
|
digitalWrite(RESET_PIN, HIGH);
|
|
|
|
|
2015-07-14 00:55:07 +00:00
|
|
|
radio.initialize();
|
|
|
|
radio.setSQOff();
|
2016-05-04 18:35:06 +00:00
|
|
|
radio.frequency(144390);
|
2015-07-14 00:55:07 +00:00
|
|
|
|
|
|
|
dds.start();
|
2016-08-17 21:17:56 +00:00
|
|
|
afsk.start(&dds);
|
2015-07-14 00:55:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void loop() {
|
|
|
|
kiss.loop();
|
|
|
|
}
|
|
|
|
|
|
|
|
ISR(ADC_vect) {
|
|
|
|
kiss.isr();
|
|
|
|
}
|