   
   setupPorts();
   setupLeds();
+  setupRadio();
   setupSensors();
 }
 

//-----------------------------------------------------------------------------
// Main Loop
//
void loop() {
  enableISRs();
  LowPower.powerDown(SLEEP_4S, ADC_OFF, BOD_OFF);
  disableISRs();
  
  sensors->measure();
  sensors->report(sensorData);
  
  blink(MOTE_LED_PIN, EXTR_LED_PIN, sensorData);
}


//-----------------------------------------------------------------------------
// Support routines
//
void enableISRs() {
  attachInterrupt(1, waterLeakChange, CHANGE);
}

void disableISRs() {
  detachInterrupt(1);
}


/* -----------------------------------------------------------------------------
   Laundry Mote Sensor
  
   Monitors a washer and dryer.
 
   Circuit:
   * Moteino R4 w/ RFM69HW RF module
   * A0 - Battery voltage monitor
   * A1 - Light detector
   * A2 - Temperature
   * D3 - Water Leak detector
 
   Created 12-APR-2015 by Jon Brule
----------------------------------------------------------------------------- */
#include <LowPower.h>
#include <Message.h>
#include <RFM69.h>
#include <Reading.h>
#include <SPI.h>
#include "Sensors.h"

#define VERSION    "v0.1"

#define SERIAL     1
#define DEBUG      1
#define BAUD_RATE  9600

#define REPORT_PERIOD  1000 * 1000

#define NODEID         7   // unique for each node on same network
#define GATEWAYID      1
#define NETWORKID      99  // same for all nodes that talk to each other
#define FREQUENCY      RF69_915MHZ

const int MOTE_LED_PIN = 9;
const int EXTR_LED_PIN = 13;

Sensors* sensors;
SensorData* sensorData;

RFM69 radio;
Message inbound, outbound;


//-----------------------------------------------------------------------------
