// Here we will write for out own Delay Time
// Find the Slope = m , and by using line Equation just like y-y1=m(x-x1) , m=(y2-y1)/(x2-x1)
int lightpin = A0 ;
int buzzpin = 8;
int lightval;
int delayT;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(lightpin , INPUT);
pinMode(buzzPin , OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
lightval = analogRead(lightpin);
Serial.println(lightVal);
delayT=(9./550.)*lightval-(9.*20./550.)+1;
digitalWrite(buzzPin , HIGH);
delay(delayT);
digitalWrite(buzzpin , LOW);
delay(delayT);
}