int led=9;
int sensorValue=0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
sensorValue = analogRead(A0);
// print out the value you read:
analogWrite(led,sensorValue/4);
Serial.println(sensorValue);
delay(1); // delay 1 milli sec in between reads for stability
}