Blinky Arduino UNO

Updated on 27 October 2022
dev board Arduino UNO
firmware Arduino
chip ATmega328P
This tutorial is more than 1 year old. If the steps below do not work, then please check the latest versions and the documentations of the individual tools used.

Before starting

Code

Download code blinky-arduino.ino
#include <Arduino.h>

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  Serial.println("HIGH");
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);

  Serial.println("LOW");
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000);
}

Makefile

BOARD?=arduino:avr:uno
PORT?=/dev/cu.usbmodem14*
BUILD=build

.PHONY: default lint all flash clean

default: lint all flash clean

lint:
	cpplint --extensions=ino --filter=-legal/copyright *.ino

all:
	arduino-cli compile --fqbn $(BOARD) --output-dir $(BUILD) ./

flash:
	arduino-cli upload --fqbn $(BOARD) --port $(PORT) --input-dir $(BUILD)

clean:
	rm -r build

Prototype

A photo of the actual setup.

Blinky Arduino UNO prototype

Schematic

Wire up the hardware accordingly

Blinky Arduino UNO schematic

Serial console

Serial output from the firmware.

Blinky Arduino UNO serial console

Blinky Arduino UNO browser

Use an external power supply and a UART-USB bridge to view the serial monitor

Blinky Arduino UNO browser

Wire up the Arduino UNO to an external power supply unit. Use a UART-USB bridge to the computer to view the serial monitor

Description

Create a blinky LED with Arduino UNO board with ATmega328p microcontroller. LED is the on-board LED_BUILTIN, GPIO13.

Use with an external power supply

As an alternative, external power supply unit can be used with an UART-USB bridge.

  1. Wireup Arduino UNO with an external power supply and UART-USB bridge to the computer
  2. Start the serial monitor on the computer.

References

Watch