#include#define uint unsigned int #define uchar unsigned char uchar code tab[]={0xee,0xed,0xeb,0xe7, 0xde,0xdd,0xdb,0xd7, 0xbe,0xbd,0xbb,0xb7, 0x7e,0x7d,0x7b,0x77,}; //0~f key position code table uchar code tab1[]={0x88,0Xbe,0Xc4,0X94,0Xb2,0X91,0X81,0Xbc, 0X80,0X90,0xa0,0x83,0xc9,0x86,0xc1,0xe1,0xff}; //0~f font code table void delay(uchar x) //millisecond delay function { flying y; for(;x>0;x--) for(y=110;y>0;y--); } scanf() //Key processing function { fly temp,temp1,i; P0=0xf0; //Assign the value of P0 to oxf0 for column scanning if(P0!=0xf0) //Determine if a key is pressed { delay(2); if(P0!=0xf0) //Check again whether a key is pressed { temp1=P0; //P0 value is assigned to temp1 P0=0x0f; //P0 value is assigned to 0x0f for row scanning temp=temp1|P0; //Merge the row and column scan values and assign them to temp } switch(temp) { case 0xee:i=1; break; case 0xed:i=2; break; case 0xeb:i=3; break; case 0xe7:i=4; break; case 0xde:i=5; break; case 0xdd:i=6; break; case 0xdb:i=7; break; case 0xd7:i=8; break; case 0xbe:i=9; break; case 0xbd:i=0; break; case 0xbb:i=10; break; case 0xb7:i=11; break; case 0x7e:i=12; break; case 0x7d:i=13; break; case 0x7b:i=14; break; case 0x77:i=15; break; } } else return 16; return i; } void display(uint temp) //display function { flying i; float z[6]; from[0]=16; z[1]=temp/10000; z[2]=temp%10000/1000; z[3]=temp%1000/100; z[4]=temp%100/10; z[5]=temp%10; for(i=0;i<6;i++) { SBUF=tab1[z[i]]; // Find the key code value according to the key value and assign the key code value to the serial port send register while(!TI); //Judge whether the serial port data transmission is completed TI=0; //Serial port data transmission completed flag cleared to 0 } } E(uchar n) { uint t=1; for(;n>0;n--) t=t*10; return t; } void main(void) //main function { uint has,has1; fly x,y,fh,j,k=0; flying zhi[6]; fly zhi1[6]; while(1) { if(x<5&&!k) { if(scanf()<10) { delay(5); if(scanf()<10) { if(x==0){zhi[0]=scanf();while(scanf()!=16);} if(x==1){zhi[1]=scanf();while(scanf()!=16);} if(x==2){zhi[2]=scanf();while(scanf()!=16);} if(x==3){zhi[3]=scanf();while(scanf()!=16);} if(x==4){zhi[4]=scanf();while(scanf()!=16);} x++; has=0; for(y=0;y 11&&scanf()<16) { delay(2); if(scanf()>9&&scanf()<16) { fh=scanf(); while(scanf()!=16); k=1; } } if(j<5&&k) { if(scanf()<10) { delay(2); if(scanf()<10) { if(j==0){zhi1[0]=scanf();while(scanf()!=16);} if(j==1){zhi1[1]=scanf();while(scanf()!=16);} if(j==2){zhi1[2]=scanf();while(scanf()!=16);} if(j==3){zhi1[3]=scanf();while(scanf()!=16);} if(j==4){zhi1[4]=scanf();while(scanf()!=16);} j++; tem1=0; for(y=0;y
Previous article:TLC5620 generates frequency-adjustable three-phase sinusoidal signals
Next article:The single chip microcomputer STC5A60S2 completes audio acquisition and output
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
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
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- Why software-defined vehicles transform cars from tools into living spaces
- How Lucid is overtaking Tesla with smaller motors
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- MSP430F249_TimerA timer
- Synthesizable Verilog Syntax (Cambridge University, photocopy)
- [RVB2601 Creative Application Development] Short recording, playback and printing of recording data
- When the carrier data reaches the receiving end, how does the receiving end identify this information?
- SparkRoad Review (7) - FPGA Serial Port Test
- Disable AD auto-start JLink
- Seeking guidance - stc microcontroller remote upgrade program
- Problems with creating sheet symbols for multi-page schematics
- Zigbee Z-Stack 3.0.1 Modify channels using broadcasting
- The STM32 FFT library calculates the amplitude normally, but the phase is different each time. Has anyone encountered this problem?