1616矩阵c语言程序,51单片机16X16点阵上移C语言程序

news/2024/11/24 0:09:19/

前面已经分享了,点阵汇编语言,想信大家大部分用C语言较多了,下面我就将16X16点阵上移C语言程序分享出来,希望能帮到需要的朋友!本人此程序有经过实物测试的。并非随意弄出来的。并且有配视频效果,可以点击查看的视频祥见:http://www.tudou.com/programs/view/D0SCJyO4RBQ/

下面是原理图,请大家祥细看看,不懂的帖子留言!

a24ad05f90b4f05f48d48216e358966b.png

#include#define uchar unsigned char

#define uint unsigned int

#define LINE P0//定义行线IO口,即74HC154控制端

#define shudu 20//字移动的速度

sbit DATA=P1^4;//74HC595数据端

sbit CLK=P1^5;//74HC595移位脉冲端

sbit CLKR=P1^6;//74HC595数据锁存端

uchar move;//移动几位变量

uchar line;//行变量

uchar word;//字节变量

uchar ji;//字节变量

uchar code table[]={

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x10,0x3F,0xF8,0x04,0x10,0x04,0x14,0xFF,0xFE,0x04,0x10,0x04,0x10,

0x3F,0xF0,0x04,0x10,0x04,0x00,0x08,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,

0x01,0x00,0x01,0x08,0x7F,0xFC,0x01,0x00,0x3F,0xF8,0x01,0x00,0xFF,0xFE,0x00,0x10,

0x1F,0xF8,0x10,0x10,0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x10,0x10,0x10,0x50,0x10,0x20,

0x01,0x10,0xFF,0x90,0x14,0x50,0x14,0x7C,0x7F,0x50,0x55,0x90,0x55,0x10,0x57,0xFE,

0x61,0x04,0x41,0x7E,0x41,0x44,0x7F,0x44,0x41,0x44,0x41,0x44,0x7F,0x7C,0x41,0x44,

0x00,0x78,0x3F,0x80,0x11,0x10,0x09,0x20,0x7F,0xFE,0x42,0x02,0x82,0x04,0x7F,0xF8,

0x04,0x00,0x07,0xF0,0x0A,0x20,0x09,0x40,0x10,0x80,0x11,0x60,0x22,0x1C,0x0C,0x08,

0x04,0x40,0x04,0x44,0xFF,0xFE,0x04,0x40,0x08,0x7C,0x09,0x44,0x7F,0xC4,0x08,0x7C,

0x0A,0x44,0x3F,0x44,0x22,0x7C,0x22,0x44,0x22,0x44,0x3E,0x44,0x22,0x94,0x01,0x08,

0x08,0x20,0x08,0x24,0xFF,0xFE,0x08,0x20,0x01,0x08,0x3F,0xFC,0x20,0x08,0x20,0x08,

0x3F,0xF8,0x20,0x08,0x20,0x00,0x20,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x80,0x00,

0x08,0x10,0x08,0x10,0x08,0x10,0x10,0x20,0x10,0x20,0x22,0x44,0x7E,0xFC,0x04,0x08,

0x08,0x10,0x10,0x20,0x20,0x40,0x7E,0xFC,0x00,0x00,0x00,0x04,0xFF,0xFE,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00

};

void delay(uchar z)

{

uchar x,y;

for(x=8;x>0;x--)

for(y=z;y>0;y--);

}

void song(uchar z)//带参数函数

{

uchar num,hang;//定义变量

hang=z;//将形参给变量

for(num=0;num<8;num++)//移动8次将数据发送完毕

{

if(hang&0x01==1)//将高7位屏蔽掉,保留最低位判断

DATA=1;//为1就将74HC595数据端置1

else

DATA=0;//否则给0

CLK=0;//上升沿送走数据

CLK=1;//高电平形成上升沿

hang>>=1;//将数移走一位

}

}

void shang()

{

for(move=10;move>0;move--)

{

ji=word;

for(line=0;line<16;line++)

{

song(~table[ji*2+1]);

song(~table[ji*2]);

ji++;

CLKR=1;//在74HC595处锁存起来

CLKR=0;

CLKR=1;

LINE=line;

delay(10);

}

}

word+=1;

if(word>=128)//7个字

{

ji=0;

word=0;

}

}

void main()

{

while(1)

{

shang();

}

}

视频祥见:http://www.tudou.com/programs/view/D0SCJyO4RBQ/


http://www.ppmy.cn/news/205226.html

相关文章

【论文阅读】An Image is Worth 16x16 Words:Transformers for Image Recognition at Scale

&#x1f6a9;前言 &#x1f433;博客主页&#xff1a;&#x1f61a;睡晚不猿序程&#x1f61a;⌚首发时间&#xff1a;2022.9.2⏰最近更新时间&#xff1a;2022.9.2&#x1f646;本文由 睡晚不猿序程 原创&#xff0c;首发于 CSDN&#x1f921;作者是蒻蒟本蒟&#xff0c;如果…

Conway‘s Game of Life 16x16(Conwaylife)

项目场景&#xff1a; Conway’s Game of Life is a two-dimensional cellular automaton. The “game” is played on a two-dimensional grid of cells, where each cell is either 1 (alive) or 0 (dead). At each time step, each cell changes state depending on how m…

《An Image is Worth 16x16 Words》完整版翻译

An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale 论文地址&#xff1a;https://arxiv.org/abs/2010.11929TensorFlow代码&#xff1a;https://github.com/google-research/vision_transformerPytorch代码&#xff1a;https://github.com/lucidrai…

16x16点阵c语言程序的十六进制,16X16点阵C语言程序(16X16 bitmap C language program).doc...

16X16点阵C语言程序(16X16 bitmap C language program) 16X16点阵C语言程序(16X16 bitmap C language program) -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- # include < reg51. H > # include < intrins. H >…

16x64LED点阵模块驱动记录(一)简单实现

驱动记录链接&#xff1a; 1、本文 2、16x64LED点阵模块驱动记录&#xff08;二&#xff09;左移实现 3、16x64LED点阵模块驱动记录&#xff08;三&#xff09;字库读取并显示 4、16x64LED点阵模块驱动记录&#xff08;四&#xff09;SST29EE020 GB2312汉字库读取 5、16x64…

设置线程池的大小

线程池的理想大小取决于被提交任务的类型以及所部署系统的特性。在代码中通常不会固定线程池的大小,而应该通过某种配置机制来提供,或者根据Runtime. availableProcessors来动态计算。 幸运的是&#xff0c;要设置线程池的大小也并不困难&#xff0c;只需要避免“过大”和“过…

16x16点阵汉字c语言,16x16led点阵滚动汉字显示设计。

下面给大家介绍下我制作的16*16led点阵设计,希望与各位电子爱好者共同讨论,共同进步。 下图是电路图连接图 下面是74HC154 4线-16线译码器引脚说明,以及地址/全能输入对应的输出表。 滚动显示C程序如下。 #include #include #define uchar unsigned char #define uint uns…

IBeginDragHandler、IDragHandler 和 IEndDragHandler 介绍

IBeginDragHandler、IDragHandler 和 IEndDragHandler 介绍 IBeginDragHandler、IDragHandler 和 IEndDragHandler 是 Unity 引擎中的三个接口&#xff0c;用于处理 UI 元素的拖放事件。这些接口通常结合使用&#xff0c;构成了 Unity 引擎的拖放事件系统。 IBeginDragHandle…