Fixed HamShield.h reference and indenting in FM Beacon example sketch.
This commit is contained in:
parent
86902d4ffc
commit
22065e08d5
|
@ -8,7 +8,7 @@ Beacon will check to see if the channel is clear before it will transmit.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <HAMShield.h>
|
#include <HamShield.h>
|
||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
|
|
||||||
HAMShield radio;
|
HAMShield radio;
|
||||||
|
@ -17,18 +17,7 @@ void setup() {
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
Serial.println("starting up..");
|
Serial.println("starting up..");
|
||||||
Wire.begin();
|
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: ");
|
Serial.print("Radio status: ");
|
||||||
int result = radio.testConnection();
|
int result = radio.testConnection();
|
||||||
Serial.println(result,DEC);
|
Serial.println(result,DEC);
|
||||||
|
@ -38,16 +27,17 @@ void setup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
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
|
||||||
//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");
|
||||||
Serial.println("Signal is clear -- Transmitting");
|
radio.setModeTransmit(); // turn on the transmitter
|
||||||
radio.setModeTransmit(); // turn on the transmitter
|
radio.morseOut("1ZZ9ZZ/B CN87 ARDUINO HAMSHIELD");
|
||||||
radio.morseOut("1ZZ9ZZ/B CN87 ARDUINO HAMSHIELD");
|
radio.setModeReceive(); // turn off the transmitter (receive mode)
|
||||||
radio.setModeReceive(); // turn off the transmitter (receive mode)
|
Serial.print("TX Off");
|
||||||
Serial.print("TX Off");
|
delay(30000);
|
||||||
//delay(30000);
|
} else {
|
||||||
//} else { Serial.println("The channel was busy. Waiting 10 seconds."); delay(10000); }
|
Serial.println("The channel was busy. Waiting 10 seconds.");
|
||||||
delay(10000);
|
delay(10000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue