 
 uint16_t readSolarVolts(uint16_t vcc) {
   // Voltage divider to half the incoming volts.
-  analogReference(DEFAULT);
-  uint16_t val;
-  // After changing the analog reference, 
-  // the first few readings from analogRead() may not be accurate.
-  for (uint8_t i = 0; i < 2; i++) { 
-    val = analogRead(PIN_SENSOR_SOLAR_VOLTS);
-  }
+  uint16_t val;
+
+  // This first reading after a mux change is unreliable.
+  val = analogRead(PIN_SENSOR_SOLAR_VOLTS);
+  
   // Add the next 2 readings.
   // To avergage and account for the halving votage divider.
   val = 0;

// Singleton instance of the radio driver
RH_RF95 rf95(RFM95_CS, RFM95_INT);

// OLED
U8GLIB_SSD1306_128X64_2X u8g(U8G_I2C_OPT_NONE);

theapi::GardenPayload tx_payload = theapi::GardenPayload();
theapi::AckPayload ack_payload = theapi::AckPayload();

uint8_t msg_id = 0;
int rssi = 0;

typedef struct {
  int sent;
  int got;
  int rssi;
}
monitor_t;
monitor_t monitor;

AES128 cipher;
uint8_t encrypted_buffer[ENCRYPTION_BUFFER_SIZE];
uint8_t decrypted_buf[ENCRYPTION_BUFFER_SIZE];

uint8_t rx_node_id = 1;
uint8_t garden_node_id = 2;

void setup() {
  pinMode(RFM95_RST, OUTPUT);
  digitalWrite(RFM95_RST, HIGH);

  Serial.begin(115200);

  //u8g.setRot180();
  monitor.sent = 0;
  monitor.got = 0;
  monitor.rssi = 0;
  displayUpdate();
  
  delay(100);


}

uint16_t readLight(uint16_t vcc) {
  uint16_t val;

  // This first reading after a mux change is unreliable.
  val = analogRead(PIN_SENSOR_LIGHT);
  
  // Average the next 2 readings.
  val = 0;
  for (uint8_t i = 0; i < 2; i++) { 
