Blinky Arduino UNO

dev board Arduino UNO
firmware Arduino
chip ATmega328P

Buy the components

Description

Create a blinky LED with Arduino UNO board with ATmega328p microcontroller.

Code

Download code
#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

Serial console

Serial output from the firmware.

Blinky Arduino UNO serial console

Prototype

A photo of the actual setup.

Blinky Arduino UNO prototype

References

Watch