#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); //pins to which RX and TX are connected

int bluelightsensePin = 6; // light sensor on pin 6
int val1 = 0; // variable to store the value read

int led = 7;        // LED on light sensor on pin 7
int val2 = 0;      // variable to store the value read

int bluecapsensePin = 1; // capacitive sensor on pin 1
int val3 = 0; // variable to store the value read

void setup()

{
  mySerial.begin(9600); //setup serial
  pinMode(led, OUTPUT); 
}

void loop ()
{
//mySerial.println ("hello");     ////run first as a test to see if there is Serial communication
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  val2 = analogRead(bluelightsensePin);       ////read the light sensor pin, with LED light  

  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  val1 = analogRead(bluelightsensePin);      //read the light sensor pin, without LED light            
  mySerial.println (val2-val1);               //print in Serial window subtract the amount of light 
                                                //without LED from the amount of light with LED

 val3 = analogRead(bluecapsensePin); //read the capacitive sensor pin
 delay(700);
 mySerial.println (val3); //print in Serial window the values that sensor gets

}
