     
     
     Serial.println(); 
-    
-    // Ofcourse this is rather pointless a sleep will kill the pwm (replacing with digital pot)
-    //analogWrite(PWM_PIN, solar_val);
-    
+        
     Serial.print(parsed_val);
     Serial.print(" -> ");
     Serial.println(solar_val); 
     
-    digitalPotWrite(POT_ADDRESS, solar_val);
+    //digitalPotWrite(POT_ADDRESS, solar_val);
+    analogWrite(PWM_PIN, solar_val);
     
     // Turn off message indicator
     analogWrite(DEBUG_LED_PIN, DEBUG_LED_PWM_AWAKE);

  // take the SS pin high to de-select the chip:
  digitalWrite(POT_CHIP_SELECT, HIGH); 
}

/**
 * Watchdog for while awake to ensure things are ticking over.

#include <VirtualWire.h>

// inslude the SPI library:
//#include <SPI.h>

#define DEBUG_LED_PIN 5 // PD5 (11) - Red led button
#define DEBUG_LED_PWM_AWAKE 127 // pwm value to show contoller is awake
#define DEBUG_LED_PWM_MSG 255 // pwm value to show message received

#define PWM_PIN 11 // timer 2
//#define POT_CHIP_SELECT 10
//#define POT_ADDRESS 0

#define VW_MAX_MESSAGE_LEN 40 // Same as solar/sensor
#define VW_RX_PIN 7 // PD7 (13)
