c51 74hc164--165--595c51
The 51 single-chip microcomputer drives the 74ls164 marquee. The advantage is that only two ports are used to achieve it. The circuit is shown in the figure below:
#include#include #define uint unsigned int #define uchar unsigned char sbit dat=P2^6; sbit clk=P2^7; uchar ii; uchar code seg7code[]=
{0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x00,0xff}; //0-9,-, all destroyed void sendbyte(uchar seg) { uchar num,c; num=seg7code[seg]; for(c=0;c<8;c++) { dat=num&0x80; num=_crol_(num,1); clk=0; clk=1; } } void delayms(int ms) { uchar mi,mj; for(;ms>0;ms--) for(mi=6;mi>0;mi--) for(mj=82;mj>0;mj--); } void main() { for(ii=0;ii<10;ii++) { sendbyte(ii); delayms(200); } }
Previous article:MCU drives ds18b20 four-way temperature patrol detection program
Next article:Using C language to realize key-controlled colored light system
Recommended ReadingLatest update time:2024-11-16 16:54
- Popular Resources
- Popular amplifiers
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- ATmega16 MCU C language programming classic example (Chen Zhongping)
- MCU Principles and Interface Technology C51 Programming (Edited by Zhang Yigang)
- Principles and Applications of Single Chip Microcomputers (Sun Baofa)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Easily solve design challenges with MSP430 MCUs
- TI Logistics Robot CPU Board
- I would like to ask which one has better performance, thank you for your recommendation
- TI supports Bluetooth technology for high-precision body temperature measurement flexible PCB reference design
- Problems of charging and discharging dual capacitors in peak detectors
- EK140P Linux-4.1.15 Test Manual
- EEWORLD University Hall----Live Replay: HARTING- How to quickly and cost-effectively install cables in electrical control cabinets
- Introduction to Machine Vision Technology
- 【RT-Thread Reading Notes】1. RT-Thread RTOS Preface
- I would like to ask about an EXCEL curve fitting formula. I cannot get the value of Y by substituting the values of X (0, 150, 300). The value of Y is not correct.