/// ...
#include
#include
#define uchar unsigned char
#define uint
sbit Duan = P2^6;
sbit Wei = P2^7;
#define Digital_tube_Wei_Enable Wei=1;
#define Digital_tube_Wei_Disable Wei=0;
#define Digital_tube_Duan_Enable Duan=1;
#define Digital_tube_Duan_Disable Duan=0;
#define Digital_tube_Duan P0
#define KEY_DOWN
#define Keyport P3
uchar code Dis_table[]=
{0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,
uchar code Dis_Position[]=
{0xfe,0xfd,0xfb,0xf7,0xef,0xdf};
...
This is done in the
same way , so if you change
the
frequency of the crystal oscillator , please
Function name: One_DigitalTube_displayFunction
: Complete the specified display of the digital tube on the experimental board, that is, display a specific number on a specific digital tube, such as
Parameter introduction: uData: BCD code array of the number to be displayed
Return value:
Note: The digital tube on the experimental board is a common cathode digital tube. If you use a common anode digital tube, be careful not
void One_DigitalTube_display(uchar uData,uchar uNumber)
{
}
...
void Scan_Keyboard()
{
}
/// ...
Function name: mainFunction
function: Continuously scan the keyboard in a loop. When a key is pressed, the corresponding value is displayed on the digital tube
Parameter introduction: None
Return value:
Notes: None
/ ...
void main()
{
}
Previous article:STC89C52 MCU external interrupt 0 experiment
Next article:STC89C52 MCU key experiment
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- 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
- C2000 Power-on Boot Mode Analysis
- CAN bus research notes
- DSP timer and interrupt system realizes variable frequency flashing of LED lights
- STM32F103VE DAC+DMA+TIM, channel 1, no signal output
- Show off the Jingdong E-card exchanged with E-coin
- Series shift register question
- PMOS Circuit Analysis
- CCS 7.4.0 imports routines of PDK_c667x_2_0_9
- 11 years of experience in microwave and radio frequency manufacturing
- I need a QFN24 packaged MCU with two ADCs, two serial ports, low power consumption, in stock, GD Zhaoyi Innovation has recommendations...