2016-08-14 02:25:46 +00:00
|
|
|
/* Hamshield
|
|
|
|
* Example: Just Transmit
|
|
|
|
* This example continuously transmits.
|
|
|
|
* Connect the HamShield to your Arduino. Screw the antenna
|
|
|
|
* into the HamShield RF jack. Plug a pair of headphones with
|
|
|
|
* built-in mic 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 to monitor the program's progress. After setup is
|
|
|
|
* complete, tune a HandyTalkie (HT) to 144.025MHz. Listen on
|
|
|
|
* the HT for the HamShield broadcasting from the mic.
|
|
|
|
*/
|
2015-07-15 03:05:20 +00:00
|
|
|
|
|
|
|
#include <HamShield.h>
|
|
|
|
|
2015-11-23 16:54:10 +00:00
|
|
|
#define PWM_PIN 3
|
|
|
|
#define RESET_PIN A3
|
|
|
|
#define SWITCH_PIN 2
|
|
|
|
|
2015-07-15 03:05:20 +00:00
|
|
|
HamShield radio;
|
|
|
|
|
|
|
|
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, HIGH);
|
|
|
|
|
2015-07-15 03:05:20 +00:00
|
|
|
Serial.begin(9600);
|
|
|
|
Serial.println("If the sketch freezes at radio status, there is something wrong with power or the shield");
|
|
|
|
Serial.print("Radio status: ");
|
|
|
|
int result = radio.testConnection();
|
|
|
|
Serial.println(result,DEC);
|
|
|
|
Serial.println("Setting radio to its defaults..");
|
|
|
|
radio.initialize();
|
2016-01-05 03:36:37 +00:00
|
|
|
radio.setRfPower(0);
|
2016-08-12 03:01:02 +00:00
|
|
|
//radio.setChanMode(3);
|
2015-07-15 03:05:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void loop() {
|
|
|
|
radio.bypassPreDeEmph();
|
2016-08-14 02:25:46 +00:00
|
|
|
radio.frequency(144025);
|
2015-07-15 03:05:20 +00:00
|
|
|
// radio.setTxSourceNone();
|
|
|
|
radio.setModeTransmit();
|
|
|
|
for(;;) { }
|
|
|
|
}
|
|
|
|
|