A little curiosity. A whole lot of making.Robotics, CNC & connected ideas
robodatech.
Arduino sample library

Digital Output 01

Blink and pulse digital pins for LEDs, relays, indicators, and simple actuators.

Open in compiler →

Source code and build tools are available in the protected platform workspace.

How it works

Turn a digital output on and off for an LED, relay module, or simple indicator.

  1. Connect the LED/resistor or module input to ledPin.
  2. Set ledPin as OUTPUT in setup().
  3. Use digitalWrite(HIGH) and digitalWrite(LOW) in loop().
  4. Change the two delay() values to control blink speed.

Connections

PinConnect toNote
D2LED through 220-330 ohm resistor, relay module input, or indicatorDo not connect a bare load directly to an Arduino pin.

Good ideas start here.

Free robotics lessons, CNC build notes and product updates. Confirm your email to join. Unsubscribe anytime.