当前位置:网站首页>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();
}
}
边栏推荐
- What if the DataGrid cannot see the table after connecting to the database
- Intelligent target detection 59 -- detailed explanation of pytoch focal loss and its implementation in yolov4
- DataGrid offline installation of database driver
- SD_CMD_SEND_SHIFT_REGISTER
- 程序中的负数存储及类型转换
- 现在有html文件,和用vs制作的mvc(连接了数据库),怎么两个相连?
- Tshydro tool
- 1290_ Implementation analysis of prvtaskistasksuspended() interface in FreeRTOS
- 【idea】Could not autowire. No beans of xxx type found
- [software testing] 04 -- software testing and software development
猜你喜欢
Literacy Ethernet MII interface types Daquan MII, RMII, smii, gmii, rgmii, sgmii, XGMII, XAUI, rxaui
The problem of configuring opencv in qt5.13.2 is solved in detail
PowerManagerService(一)— 初始化
【软件测试】06 -- 软件测试的基本流程
SOC_SD_CMD_FSM
And play the little chestnut of dynamic agent
Ros2 topic (VIII)
Word import literature -mendeley
三体目标管理笔记
2022年PMP项目管理考试敏捷知识点(7)
随机推荐
2022.06.27_每日一题
C#学习笔记
2022 PMP project management examination agile knowledge points (7)
Delayqueue usage and scenarios of delay queue
Import CV2, prompt importerror: libcblas so. 3: cannot open shared object file: No such file or directory
Use of Pai platform
PowerManagerService(一)— 初始化
氫氧化鈉是什麼?
Ros2 - workspace (V)
Machine learning Seaborn visualization
HDU1232 畅通工程(并查集)
Literacy Ethernet MII interface types Daquan MII, RMII, smii, gmii, rgmii, sgmii, XGMII, XAUI, rxaui
PostMessage communication
Anaconda navigator click open no response, can not start error prompt attributeerror: 'STR' object has no attribute 'get‘
What does soda ash do?
SOC_SD_DATA_FSM
Oracle code use
逻辑结构与物理结构
三体目标管理笔记
Word import literature -mendeley