int bulb=10;
int pot=A1;
void setup() {
// put your setup code here, to run once:
pinMode(bulb, OUTPUT);
pinMode(pot, INPUT);
pinMode(11,OUTPUT) ;
Serial. begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int val=analogRead(A1);
Serial.println(val) ;
tone(11,2000);
delay(50);
tone(11,3500);
delay(100);
tone(11,1000) ;
digitalWrite(bulb, HIGH);
delay(val) ;
digitalWrite(bulb, LOW);
delay(val) ;
}