 #include <avr/power.h>    // Power management
 #include <VirtualWire.h>
 
-#include <TinyWireS.h>
-#include <usiTwiSlave.h>
 
 #define LED_DEBUG 0 
 #define PIN_TX 3 // PB3
 
-#define PIN_WAKEUP_MASTER 1 // PB1 Connected to the atmega328 external interupt pin.
+#define PIN_MISO 1 // PB1  (DO)  -> atmega MISO & external interupt
+#define PIN_MOSI 0 // PB0  (DI)  -> atmega MOSI
+#define PIN_SCL  2 // PB2 (USCK) -> atmega SCL 
 
-#define PIN_WAKEUP_SELF 4   // PB4 / pin 3 / LDR attached
-//#define PIN_LDR 2           // PB4 / pin 3 / A2 - NB: ANALOG pin 2 not digital pin 2
+#define PIN_WAKEUP_SELF 4   // PB4 / pin 3 / LDR attached - HIGH = wakeup
 
-//#define THRESHOLD_DARK 200 // A reading below this is considered dark.
 
-#define I2C_SLAVE_ADDR 100
 
 byte msgId = 0;
 int ldr_val = 0;

//                  +----+
// see http://www.gammon.com.au/forum/?id=11488&reply=9#reply9

// i2c http://playground.arduino.cc/Code/USIi2c 
// library from http://playground.arduino.cc/uploads/Code/TinyWireS.zip

 
#include <util/delay.h>

  MCUSR = 0; // clear the reset register 
  power_all_enable();    // power everything back on
  
  //ADCSRA = (1 << ADEN); // ADC back on
  
} 

