Robotics & Artificial Intelligence

Explain the use of digitalWrite() function.

Tinkercad

2 Likes

Answer

The digitalWrite() function is used to control the state of a digital pin on the Arduino microcontroller. It is used to send a HIGH or LOW signal through an output pin.

  • HIGH means the pin outputs 5 V (ON)
  • LOW means the pin outputs 0 V (OFF)

Syntax:
digitalWrite(pin, value);
Where pin = digital pin number, and value = HIGH or LOW.

Example:
digitalWrite(3, HIGH);
will send a HIGH signal through pin 3

Answered By

1 Like


Related Questions