单片机学习-led点阵屏

总结下之前学的

  1. 定时器

TMOD的配置,设置定时器模式。

然后设置初值TL,TH。

运行模式TR。

中断小开关,ET,EA,优先级暂时还没有去深入


再就是这几天看了led点阵屏的视屏

#include #include "Delay.h"sbit RCK=P3^5;//RCLKsbit SCK=P3^6;//SRCLKsbit SER=P3^4;//SER#define MATRIX_LED_PORTP0void _74HC595_WriteByte(unsigned char Byte){unsigned char i;for(i=0;i<8;i++){SER=Byte&(0x80>>i);SCK=1;SCK=0;}RCK=1;RCK=0;}void MatrixLED_ShowColumn(unsigned char Column,Data){_74HC595_WriteByte(Data);MATRIX_LED_PORT=~(0x80>>Column);Delay(1);MATRIX_LED_PORT=0xFF;}void main(){SCK=0;RCK=0;while(1){MatrixLED_ShowColumn(0,0x3C);MatrixLED_ShowColumn(1,0x42);MatrixLED_ShowColumn(2,0xA9);MatrixLED_ShowColumn(3,0x85);MatrixLED_ShowColumn(4,0x85);MatrixLED_ShowColumn(5,0xA9);MatrixLED_ShowColumn(6,0x42);MatrixLED_ShowColumn(7,0x3C);}}

发表评论
留言与评论(共有 0 条评论) “”
   
验证码:

相关文章

推荐文章