2016-08-13 21:05:19 +00:00
|
|
|
/* Hamshield
|
|
|
|
* Example: SSTV
|
|
|
|
* This program will transmit a test pattern. You will need
|
|
|
|
* SSTV receive equipment to test the output.
|
|
|
|
* 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. After uploading
|
|
|
|
* this program to your adruino, open the Serial Monitor to
|
|
|
|
* view the status of the program. Tune your SSTV to
|
|
|
|
* 446MHz to receive the image output.
|
2015-06-20 20:37:48 +00:00
|
|
|
*/
|
|
|
|
|
2015-11-23 16:54:10 +00:00
|
|
|
#define PWM_PIN 3
|
|
|
|
#define RESET_PIN A3
|
|
|
|
#define SWITCH_PIN 2
|
|
|
|
|
2015-06-20 20:37:48 +00:00
|
|
|
#define DOT 100
|
|
|
|
#define CALLSIGN "1ZZ9ZZ/B"
|
|
|
|
|
|
|
|
/* Standard libraries and variable init */
|
|
|
|
|
2016-04-14 02:12:06 +00:00
|
|
|
#include <HamShield.h>
|
2015-06-20 20:37:48 +00:00
|
|
|
|
2016-04-14 02:12:06 +00:00
|
|
|
HamShield radio;
|
2015-06-20 20:37:48 +00:00
|
|
|
int16_t rssi;
|
|
|
|
|
|
|
|
/* get our radio ready */
|
|
|
|
|
2015-11-23 16:54:10 +00:00
|
|
|
void setup() {
|
|
|
|
// 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-06-20 20:37:48 +00:00
|
|
|
Serial.begin(9600);
|
|
|
|
Serial.print("Radio status: ");
|
|
|
|
int result = radio.testConnection();
|
|
|
|
Serial.println(result);
|
|
|
|
radio.initialize();
|
2015-11-23 16:54:10 +00:00
|
|
|
radio.frequency(446000);
|
2015-06-20 20:37:48 +00:00
|
|
|
radio.setModeReceive();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* main program loop */
|
|
|
|
|
|
|
|
|
|
|
|
void loop() {
|
|
|
|
if(radio.waitForChannel(1000,2000)) { // Wait forever for calling frequency to open, then wait 2 seconds for breakers
|
|
|
|
radio.setModeTransmit(); // Turn on the transmitter
|
|
|
|
delay(250); // Wait a moment
|
|
|
|
radio.SSTVTestPattern(MARTIN1); // send a MARTIN1 test pattern
|
|
|
|
delay(250);
|
|
|
|
radio.setModeReceive(); // Turn off the transmitter
|
|
|
|
} else { delay(30000); } // someone broke in fast after prior transmission, was it an emergency? wait 30 secs.
|
|
|
|
|
|
|
|
delay(60000); // Wait a minute
|
|
|
|
}
|
|
|
|
|