 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include <avr/interrupt.h>
+
 
 extern "C" {
 




	int prevPhotoState = photoState();
	delay(200);								
	// !! REMOVE DELAY !!
	if (photoState() != prevPhotoState) {

		sendSensorData();

	}


	if (Serial.available() > 0) {

void setup() 
{

	// Configure pins
	pinMode(photoPin, INPUT);			// open pin for reading input
	pinMode(valvePin, OUTPUT);			// open pin attached to relay board
	Serial.begin(9600);					// initialize serial data stream
	
	// Configure interrupts
	sei();								// enable global interrupts
	EIMSK |= (1 << INT0);				// enable external interrupt INT0 (I/O pin 2)
	EICRA |= (1 << ISC00);				// trigger INT0 on any logical change





}

