//Declare variable for pin digital input

int sensor1State = 0;


void setup()

{

  //begin serial monitor at 9600 baud rate to communicate with Processing

  Serial.begin(9600);

  pinMode (sensor1, INPUT);

  digitalWrite(sensor1, HIGH);

}

void loop()

{

  sensor1State = digitalRead(sensor1);

//print value read from the digital pin and print ascii code 10 or "A"

//Processing will look for ascii code 10 before reading value of the sensor

  Serial.print(sensor1State);

  Serial.write(10);

  

}