37 lines
661 B
Arduino
37 lines
661 B
Arduino
|
#define DDS_REFCLK_DEFAULT 19200
|
||
|
|
||
|
#include <HamShield.h>
|
||
|
#include <Wire.h>
|
||
|
#include <KISS.h>
|
||
|
|
||
|
HamShield radio;
|
||
|
DDS dds;
|
||
|
KISS kiss(&Serial, &radio, &dds);
|
||
|
|
||
|
void setup() {
|
||
|
pinMode(2, OUTPUT);
|
||
|
pinMode(3, OUTPUT);
|
||
|
pinMode(11, INPUT);
|
||
|
|
||
|
Serial.begin(9600);
|
||
|
Wire.begin();
|
||
|
radio.initialize();
|
||
|
radio.setVHF();
|
||
|
radio.setSQOff();
|
||
|
radio.setFrequency(145010);
|
||
|
I2Cdev::writeWord(A1846S_DEV_ADDR_SENLOW, 0x30, 0x06);
|
||
|
I2Cdev::writeWord(A1846S_DEV_ADDR_SENLOW, 0x30, 0x26);
|
||
|
I2Cdev::writeWord(A1846S_DEV_ADDR_SENLOW, 0x44, 0b0000011111111111);
|
||
|
|
||
|
dds.start();
|
||
|
radio.afsk.start(&dds);
|
||
|
}
|
||
|
|
||
|
void loop() {
|
||
|
kiss.loop();
|
||
|
}
|
||
|
|
||
|
ISR(ADC_vect) {
|
||
|
kiss.isr();
|
||
|
}
|