Initial commit of HamShield library and example sketches. Probably not fully functional.

This commit is contained in:
Nigel Vander Houwen
2015-06-20 13:37:48 -07:00
parent c551fd9508
commit 23ba8f6e7c
34 changed files with 4789 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
/*
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.
*/
#include <HAMShield.h>
#include <Wire.h>
HAMShield radio;
void setup() {
Serial.begin(9600);
Serial.println("starting up..");
Wire.begin();
pinMode(11, OUTPUT);
//testing
//Wire.beginTransmission(42);
//Wire.write('T');
//Wire.write('e');
//Wire.write('s');
//Wire.write('t');
//Wire.endTransmission();
Serial.print("Radio status: ");
int result = radio.testConnection();
Serial.println(result,DEC);
radio.initialize(); // setup radio
radio.setFrequency(446000); // set to 70 cm call frequency
Serial.println("Done with radio beacon setup.");
}
void loop() {
//while(1){}
//if(radio.waitForChannel(30000,2000)) { // wait up to 30 seconds for a clear channel, and then 2 seconds of empty channel
Serial.println("Signal is clear -- Transmitting");
radio.setModeTransmit(); // turn on the transmitter
radio.morseOut("1ZZ9ZZ/B CN87 ARDUINO HAMSHIELD");
radio.setModeReceive(); // turn off the transmitter (receive mode)
Serial.print("TX Off");
//delay(30000);
//} else { Serial.println("The channel was busy. Waiting 10 seconds."); delay(10000); }
delay(10000);
}