예제 #1
0
// setup the output pins and the RF link
void setup() {
	// initialize the LED 1 pins
	pinMode(LED1_RED, OUTPUT);
	pinMode(LED1_GREEN, OUTPUT);
	pinMode(LED1_BLUE, OUTPUT);

	// initialize the LED 2 pins
	pinMode(LED2_RED, OUTPUT);
	pinMode(LED2_GREEN, OUTPUT);
	pinMode(LED2_BLUE, OUTPUT);

	_selfTest();

	// Start serial communication for debug output
	Serial.begin(9600);
	Serial.println("XFVWLamp ready");

	// Initialize and start VirtualWire
	vw_set_rx_pin(RX_PIN); // Set the receive pin to RX_PIN
	vw_set_tx_pin(TX_PIN);
	vw_set_ptt_pin(PTT_PIN);

	vw_setup(2000); // Bits per sec
	vw_rx_start(); // Start the receiver PLL running
}
예제 #2
0
/////////////////////////////////////
// 
// Initialize the radio interface
//
void init_radio(void) {
	vw_set_ptt_pin(10);		// defaults to 10
	vw_set_rx_pin(11);		// defaults to 11
	vw_set_tx_pin(12);		// defaults to 12
	vw_setup(2000);			// set up for 2000 bps
	vw_rx_start();			// start the rx
	radio_go = 1;			// mark the rf system "up"
}