Guía de Usuario USBasp V3.0| HeTPro
5.1.7 MANEJO DE MATRIZ DE LED'S Y TECLADO MATRICIAL
En este programa se verán un par de cosas, una de ellas es un teclado matricial
utilizando un solo pin del puerto (ADC) y la otra es el manejo de una matriz de LED's.
#include <AVR/io.h>
#include <util/delay.h>
int Matriz=0;
int numero[12][8] = {{255,129,60,60,60,60,129,255}, //0
void num_matriz(int num){
PORTB=0b10000000;
PORTD=numero[num][0];
_delay_ms(2);
PORTB=0b01000000;
PORTD=numero[num][1];
_delay_ms(2);
{255,255,190,0,0,254,255,255},
{156,56,56,56,52,44,28,152},
{153,60,60,44,12,12,33,97},
{191,15,15,239,239,239,0,0},
{233,200,172,44,44,44,32,177},
{241,192,172,44,44,44,32,177},
{159,63,60,56,51,39,15,63},
{153,0,102,102,102,102,0,153},
{141,54,54,54,54,54,0,129},
{102,165,195,0,0,195,165,102},
{219,219,0,219,219,0,219,219}};
//1
//2
//3
//4
//5
//6
//7
//8
//9
//*
//#
49