/* XRF Arduino Test Sketch - Beacon Client Relay * * Full details of this example: http://bit.ly/sPPN8a * * Simple sketch to test a pair of XRF modules are working. Listens * for the letter "H" (Hello) on the serial line, and sends the letter * "K" (OK) in response. * * I'm using 2 x XRF modules and 2 x Xbee sheilds from Ciseco, and an * Arduino Uno and Arduino Ethernet. The default XRF baud rate in 9600. * * This sketch (2 of 2) is running on the Arduino Ethernet which * doesn't have a built in LED, so there's nothing for us to blink by * way of acknowledgement. * * Created 4 Dec 2011 * by Mark Sweeting - www.sweeting.org/mark */ int XbeeEnable = 8; void setup() { pinMode(XbeeEnable, OUTPUT); // Turn XRF on digitalWrite(XbeeEnable, HIGH); Serial.begin(9600); } void loop() { // listen out for the letter "H", and send a "K" if we get one. if(Serial.available() > 0) { if(Serial.read() == 'H') { Serial.print('K'); } } }