当前位置:网站首页>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();
}
}
边栏推荐
- 苏打粉是什么?
- Ros2 - first acquaintance with ros2 (I)
- Altimeter data knowledge point 2
- Steps and FAQs of connecting windows Navicat to Alibaba cloud server MySQL
- U-boot initialization and workflow analysis
- Anaconda navigator click open no response, can not start error prompt attributeerror: 'STR' object has no attribute 'get‘
- Three body goal management notes
- 小米笔试真题一
- list. files: List the Files in a Directory/Folder
- Tshydro tool
猜你喜欢
Target detection series - detailed explanation of the principle of fast r-cnn
Chapter 2: try to implement a simple bean container
Concurrent programming - deadlock troubleshooting and handling
SOC_SD_CMD_FSM
C learning notes
Powermanagerservice (I) - initialization
IPage能正常显示数据,但是total一直等于0
docker安装mysql并使用navicat连接
【软件测试】06 -- 软件测试的基本流程
Pytorch has been installed in anaconda, and pycharm normally runs code, but vs code displays no module named 'torch‘
随机推荐
【obs】x264编码:“buffer_size“
MySQL setting trigger problem
Ros2 topic (VIII)
[tf1] save and load parameters
三体目标管理笔记
Raspberry pie 4B arm platform aarch64 PIP installation pytorch
Database SQL practice 3. Find the current salary details of the current leaders of each department and their corresponding department number Dept_ no
【软件测试】02 -- 软件缺陷管理
Interpretation of the earliest sketches - image translation work sketchygan
Typescript get timestamp
Energy conservation and creating energy gap
Altimeter data knowledge point 2
纯碱是做什么的?
The golang timer uses the stepped pit: the timer is executed once a day
Unity UGUI不同的UI面板或者UI之间如何进行坐标匹配和变换
你心目中的数据分析 Top 1 选 Pandas 还是选 SQL?
[solved] there is something wrong with the image
乐鑫面试流程
Don't confuse the use difference between series / and / *
Inftnews | drink tea and send virtual stocks? Analysis of Naixue's tea "coin issuance"