当前位置:网站首页>Simple operation of nixie tube (keil5)
Simple operation of nixie tube (keil5)
2022-07-05 07:18:00 【After reading thousands of books, you can pick them up and put 】
Every bit of the nixie tube starts from 0 Light to f Jump to the next one , Then all the bits start from 0 Light to f
#include <STC15F2K60S2.H>
#include <intrins.h>
int i,j;
unsigned char code num[16]={
0xc0,0xcf,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x98,0x88,0x80,0xc6,0xc0,0x86,0x8e};//0123456789abcd
/*************************************************/
void initsystem(unsigned char i)
{
switch(i)
{
case 4:
P2=0X8f&(P2|0xe0);// open y4 Latch
break;
case 5:
P2=0xbf&(P2|0xe0);// open y5 Latch
break;
case 6:
P2=0xdf&(P2|0xe0);// open y6 Latch
break;
case 7:
P2=0xff&(P2|0xe0);// open y7 Latch
break;
case 0:
P2=0x1f&(P2|0xe0);// Close the latch
break;
}
}
/*******************************************/
void Delay100ms() //@11.0592MHz
{
unsigned char i, j, k;
_nop_();
_nop_();
i = 5;
j = 52;
k = 195;
do
{
do
{
while (--k);
} while (--j);
} while (--i);
}
/*****************************************************************/
void SMG_change()// Each from 0 Light to f, And then all from o Light to f.
{
for(i=0;i<8;i++)
{
initsystem(6);
P0=0x01<<i;
for(j=0;j<16;j++)
{
initsystem(7);
P0=num[j];
Delay100ms();
Delay100ms();
Delay100ms();
}
}
initsystem(6);
P0=0xff;
for(j=0;j<16;j++)
{
initsystem(7);
P0=num[j];
Delay100ms();
Delay100ms();
Delay100ms();
}
}
/*********************************************************************/
void main()
{
initsystem(4);// open y4
P0=0xff;// Turn off the lights
initsystem(0);// Turn off y4
initsystem(5);// open y5
P0=0x00;// Turn off the relay buzzer
initsystem(0);// Turn off y5
while(1)
{
SMG_change();
}
}
边栏推荐
- PowerManagerService(一)— 初始化
- [untitled]
- GPIO port bit based on Cortex-M3 and M4 with operation macro definition (can be used for bus input and output, STM32, aducm4050, etc.)
- Tshydro tool
- Ros2 - configuration development environment (V)
- ImportError: No module named ‘Tkinter‘
- Unity ugui how to match and transform coordinates between different UI panels or uis
- Executealways of unity is replacing executeineditmode
- Logical structure and physical structure
- And let's play dynamic proxy (extreme depth version)
猜你喜欢
M2dgr slam data set of multi-source and multi scene ground robot
Docker installs MySQL and uses Navicat to connect
Chapter 2: try to implement a simple bean container
Jenkins reported an error. Illegal character: '\ufeff'. Class, interface or enum are required
[software testing] 06 -- basic process of software testing
一文揭开,测试外包公司的真实情况
Ros2 - common command line (IV)
逻辑结构与物理结构
HDU1232 畅通工程(并查集)
SD_CMD_SEND_SHIFT_REGISTER
随机推荐
SOC_ SD_ CMD_ FSM
[OBS] x264 Code: "buffer_size“
【obs】x264编码:“buffer_size“
1290_FreeRTOS中prvTaskIsTaskSuspended()接口实现分析
【软件测试】02 -- 软件缺陷管理
Docker installs MySQL and uses Navicat to connect
你心目中的数据分析 Top 1 选 Pandas 还是选 SQL?
Course learning accumulation ppt
2022 PMP project management examination agile knowledge points (7)
NPM and package common commands
全局变量和静态变量的初始化
[vscode] recommended plug-ins
ModuleNotFoundError: No module named ‘picamera‘
What is sodium hydroxide?
And play the little chestnut of dynamic agent
Initialization of global and static variables
HDU1231 最大连续子序列(分治or动规or双指针)
Altimeter data knowledge point 2
[software testing] 06 -- basic process of software testing
并发编程 — 如何中断/停止一个运行中的线程?