Commit 21598e5f authored by Brandon Fan's avatar Brandon Fan
Browse files

update function code

parent 181522a1
......@@ -59,14 +59,11 @@ void loop() {
void turnOnLight(int trigPin, int time1, int time2) {
VirtualDelay delay1;
VirtualDelay delay2;
delay1.start(time1);
if (delay1.elapsed()) {
digitalWrite(trigPin, HIGH);
delay2.start(time2);
if (delay2.elapsed()) {
digitalWrite(trigPin, LOW);
}
delay(time2);
digitalWrite(trigPin, LOW);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment