https://blog.naver.com/dododokim/221368935252
#define F_CPU 16000000UL
#include <avr/io.h>
#include <util/delay.h>
unsigned char arr[10][8]={
{0xff, 0xff, 0x81, 0x7e, 0x7e, 0x81, 0xff, 0xff},
{0xff, 0xff, 0x7b, 0x7d, 0x00, 0x7f, 0xff, 0xff},
{0xff, 0xff, 0x1d, 0x6e, 0x76, 0x79, 0xff, 0xff},
{0xff, 0xff, 0xbd, 0x76, 0x76, 0x89, 0xff, 0xff},
{0xff, 0xe7, 0xeb, 0xed, 0x00, 0xef, 0xff, 0xff},
{0xff, 0xff, 0x70, 0x76, 0x76, 0x8e, 0xff, 0xff},
{0xff, 0xff, 0x83, 0x6d, 0x6e, 0x6e, 0x9d, 0xff},
{0xff, 0xff, 0x7e, 0x9e, 0xe6, 0xf8, 0xff, 0xff},
{0xff, 0xff, 0x89, 0x76, 0x76, 0x89, 0xff, 0xff},
{0xff, 0xff, 0xb9, 0x76, 0x76, 0x81, 0xff, 0xff}
};
int i,j, time = 0;
int main (void)
{
DDRF= DDRE = 0xFF;
while(1)
{
for(i=0;i<10;i++)
{
for(time=0;time<100;time++)
{
for(j=0;j<8;j++)
{
PORTE=0b00000001<<j;
PORTF=arr[i][j];
_delay_ms(1);
}
}
}
}
}
#define F_CPU 16000000UL
#include <avr/io.h>
#include <util/delay.h>
unsigned char arr[10][8]={
{0xff, 0xff, 0x81, 0x7e, 0x7e, 0x81, 0xff, 0xff},
{0xff, 0xff, 0x7b, 0x7d, 0x00, 0x7f, 0xff, 0xff},
{0xff, 0xff, 0x1d, 0x6e, 0x76, 0x79, 0xff, 0xff},
{0xff, 0xff, 0xbd, 0x76, 0x76, 0x89, 0xff, 0xff},
{0xff, 0xe7, 0xeb, 0xed, 0x00, 0xef, 0xff, 0xff},
{0xff, 0xff, 0x70, 0x76, 0x76, 0x8e, 0xff, 0xff},
{0xff, 0xff, 0x83, 0x6d, 0x6e, 0x6e, 0x9d, 0xff},
{0xff, 0xff, 0x7e, 0x9e, 0xe6, 0xf8, 0xff, 0xff},
{0xff, 0xff, 0x89, 0x76, 0x76, 0x89, 0xff, 0xff},
{0xff, 0xff, 0xb9, 0x76, 0x76, 0x81, 0xff, 0xff}
};
int i,j, time = 0;
int main (void)
{
DDRF= DDRE = 0xFF;
while(1)
{
for(i=0;i<10;i++)
{
//for(time=0;time<100;time++)
//{
for(j=0;j<8;j++)
{
PORTE=0b00000001<<j;
PORTF=arr[i][j];
_delay_ms(1);
}
_delay_ms(500);
// }
}
}
}
'임베디드 > Atmega128' 카테고리의 다른 글
atmega128- 03_external_pulldown 외부 풀다운 (0) | 2020.12.17 |
---|---|
가져온 코드 (0) | 2020.12.15 |
반도체 다이오드 트랜지스터 (0) | 2020.12.14 |
HBE - MCU - Multi 2 base 로 배우는 마이크로 컨트롤러(AVR) (0) | 2020.12.13 |
도트매트릭스 8x8 차례대로 켜기 / ㄹ 모양으로 흐르게 하기 (0) | 2020.12.09 |