Download Print this page

Seeed Grove Beginner Kit User Manual page 14

For arduino
Hide thumbs Also See for Grove Beginner Kit:

Advertisement

Grove Beginner Kit For Arduino®
pin: the Arduino pin number to set the mode of.
mode:
,
INPUT
OUTPUT
Setting ledPin to the output mode.
digitalWrite(ledPin, HIGH);
Description:
Write a
or a
HIGH
LOW
If the pin has been configured as an OUTPUT with pinMode(), its voltage will be set to the
corresponding value: 5V (or 3.3V on 3.3V boards) for
If the pin is configured as an INPUT, digitalWrite() will enable (HIGH) or disable (LOW) the internal
pullup on the input pin. It is recommended to set the pinMode() to
internal pull-up resistor. See the Digital Pins tutorial for more information.
If you do not set the pinMode() to OUTPUT, and connect an LED to a pin, when calling
digitalWrite(HIGH), the LED may appear dim. Without explicitly setting pinMode(), digitalWrite()
will have enabled the internal pull-up resistor, which acts as a large current-limiting resistor.
Syntax:
digitalWrite(pin, value)
Parameters:
pin: the Arduino pin number.
value:
or
.
HIGH
LOW
When we set the ledPin as output, HIGH means sending high level to the pin, LED turns on.
digitalWrite(ledPin, LOW);
When we set the led as output, low stands for sending low level to the pin, LED turns off.
delay(1000);
Description:
Pauses the program for the amount of time (in milliseconds) specified as a parameter. (There are
1000 milliseconds in a second.)
Syntax:
delay(ms)
, or
.
INPUT_PULLUP
value to a digital pin.
13
, 0V (ground) for
HIGH
LOW
INPUT_PULLUP
.
to enable the

Advertisement

loading
Need help?

Need help?

Do you have a question about the Grove Beginner Kit and is the answer not in the manual?