当前位置:网站首页>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();
}
}
边栏推荐
- 【无标题】
- 并发编程 — 如何中断/停止一个运行中的线程?
- SD_CMD_RECEIVE_SHIFT_REGISTER
- Application of MATLAB in Linear Algebra (4): similar matrix and quadratic form
- 基于Cortex-M3、M4的GPIO口位带操作宏定义(可总线输入输出,可用于STM32、ADuCM4050等)
- golang定时器使用踩的坑:定时器每天执行一次
- PHY drive commissioning --- mdio/mdc interface Clause 22 and 45 (I)
- Brief description of inux camera (Mipi interface)
- Matlab在线性代数中的应用(四):相似矩阵及二次型
- The golang timer uses the stepped pit: the timer is executed once a day
猜你喜欢

Altimeter data knowledge point 2

【Node】nvm 版本管理工具

PostMessage communication

三体目标管理笔记

数学分析_笔记_第8章:重积分

Inftnews | drink tea and send virtual stocks? Analysis of Naixue's tea "coin issuance"

SOC_ SD_ CMD_ FSM

Concurrent programming - deadlock troubleshooting and handling

2022 PMP project management examination agile knowledge points (7)

docker安装mysql并使用navicat连接
随机推荐
Application of MATLAB in Linear Algebra (4): similar matrix and quadratic form
Raspberry pie 4B arm platform aarch64 PIP installation pytorch
Xiaomi written test real question 1
[software testing] 03 -- overview of software testing
Ros2 - workspace (V)
M2dgr slam data set of multi-source and multi scene ground robot
The difference between new and malloc
Now there are HTML files and MVC made with vs (connected to the database). How can they be connected?
ImportError: No module named ‘Tkinter‘
Ros2 - configuration development environment (V)
Mathematical analysis_ Notes_ Chapter 8: multiple integral
你心目中的数据分析 Top 1 选 Pandas 还是选 SQL?
Implementation of one-dimensional convolutional neural network CNN based on FPGA (VIII) implementation of activation layer
Lexin interview process
Database SQL practice 4. Find the last of employees in all assigned departments_ Name and first_ name
Literacy Ethernet MII interface types Daquan MII, RMII, smii, gmii, rgmii, sgmii, XGMII, XAUI, rxaui
How can Oracle SQL statements modify fields that are not allowed to be null to allow nulls?
PowerManagerService(一)— 初始化
MySQL setting trigger problem
Qu'est - ce que l'hydroxyde de sodium?