ATtiny13 – running dots & digits on 7-segment LED tube display

This article shows how to make an example project of “running dots & digits” using ATtiny13 and popular 7-segment LED tube display based on MAX7219/MAX7221. Complete code is on GitHub.

MAX7219/MAX7221 library for LED tube display

A lightweight library for 7-segments LED tube displays based on MAX7219/MAX7221 chip that works with tinyAVR family (ATtiny13, ATtiny25, ATtiny45, ATtiny85) can be found here .

Parts

Circuit Diagram

Firmware

This code is written in C and can be compiled using the avr-gcc. More details on how compile this project is here.

/**
 * Copyright (c) 2017, Łukasz Marcin Podkalicki <lpodkalicki@gmail.com>
 * ATtiny13/032
 * Example project of "Running Digits & Dots" using
 * 7-segment LED tube display based on MAX7219 chip.
 */

#include <stdint.h>
#include <util/delay.h>
#include "max7219.h"

int
main(void)
{
	uint8_t i, j = 0;

	/* setup */
	MAX7219_init();
	MAX7219_set_intensity(8);

	/* loop */
	while (1) {
		for (i = 0; i < 8; ++i) {
			MAX7219_display_digit(i, (i + j) % 10);
		}
		MAX7219_clear_dot(j % 8);
		MAX7219_display_dot(++j % 8);
		_delay_ms(200);
	}
}

2 thoughts on “ATtiny13 – running dots & digits on 7-segment LED tube display

Leave a Comment