void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(10, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int sensorValue=analogRead(A0);
Serial.println("sensor value=");
Serial.println(sensorValue);
delay(100);
int pwm = map(sensorValue,0,1023,0,255);
analogWrite(10,pwm);
Serial.println("pwm value=");
Serial.println(pwm);
delay(100);
}