当前位置:网站首页>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 is sodium hydroxide?
- Inftnews | drink tea and send virtual stocks? Analysis of Naixue's tea "coin issuance"
- 【idea】Could not autowire. No beans of xxx type found
- Batch convert txt to excel format
- C#学习笔记
- Ros2 - node (VII)
- Ros2 - ros2 vs. ros1 (II)
- (top) pretty girl binary color code portal
- 睿智的目标检测59——Pytorch Focal loss详解与在YoloV4当中的实现
- Machine learning Seaborn visualization
猜你喜欢
DataGrid offline installation of database driver
PowerManagerService(一)— 初始化
postmessage通信
[idea] efficient plug-in save actions to improve your work efficiency
IPage能正常显示数据,但是total一直等于0
Ros2 - function package (VI)
2022年PMP项目管理考试敏捷知识点(7)
Don't confuse the use difference between series / and / *
Ethtool principle introduction and troubleshooting ideas for network card packet loss (with ethtool source code download)
Target detection series - detailed explanation of the principle of fast r-cnn
随机推荐
【软件测试】03 -- 软件测试概述
Ros2 - node (VII)
Ros2 - Service Service (IX)
Ethtool principle introduction and troubleshooting ideas for network card packet loss (with ethtool source code download)
PostMessage communication
2022年PMP项目管理考试敏捷知识点(7)
【无标题】
Special training of C language array
IPage能正常显示数据,但是total一直等于0
arcpy. SpatialJoin_ Analysis spatial connection analysis
ModuleNotFoundError: No module named ‘picamera‘
基于FPGA的一维卷积神经网络CNN的实现(八)激活层实现
Initialization of global and static variables
Matrix and TMB package version issues in R
Reading literature sorting 20220104
[OBS] x264 Code: "buffer_size“
[idea] efficient plug-in save actions to improve your work efficiency
Machine learning Seaborn visualization
小米笔试真题一
C#学习笔记