Arduino स्केच में 1 सेकंड की देरी बनाने के लिए निम्नलिखित में से कौन सा सही सिंटैक्स है?
Which of the following is the correct syntax for creating a delay of 1 second in an Arduino sketch?
A
delay(1);
B
delay(1000);
C
delay(60);
D
delay(60000);
Explanation
In Arduino, the delay() function takes the delay time in milliseconds. To create a delay of 1 second, you need to use 1000 milliseconds.
Correct Syntax:
delay(1000); // Delays for 1 second (1000 milliseconds)
Explanation:
delay(1): Delays for 1 millisecond.delay(1000): Delays for 1000 milliseconds, which is equivalent to 1 second.delay(60): Delays for 60 milliseconds.delay(60000): Delays for 60,000 milliseconds, which is equivalent to 1 minute.
Correct Answer:
(B) delay(1000);
Correct Answer: B) delay(1000);