Hardware Reference
In-Depth Information
delay(ms);
Parameters
ms
The number of milliseconds to wait
Return value None.
Example
delay(1000);
This causes the execution of code to stop for one second (1,000 milisec-
onds).
digitalRead
Reads the value of an input pin and returns high or low. See “digitalRead()”
on page 73 .
Syntax
digitalRead(pin);
Return value
HIGH or LOW.
Parameters
pin
The pin number
Example
if ( digitalRead(9) == HIGH ) {
Serial.println("Pin 9 is high.")
}
This prints “Pin 9 is high.” if it's connected to 5 volts (or 3.3 volts if the IOREF
jumper is set to 3.3V).
digitalWrite
Sets the value of a digital pin to high or low (on or off). See “digitalWrite()”
on page 38 .
Syntax
digitalWrite(pin, value);
Parameters
Search WWH ::




Custom Search