(
(n>>21)&0x80 \
(n>>18)&0x40 \
(n>>15)&0x20 \
(n>>12)&0x10 \
(n>>9)&0x08 \
(n>>6)&0x04 \
(n>>3)&0x02 \
(n>>0)&0x01 \
)
#define Bin(n) (0x##n##L)
1. The function of \ is to make the content of the next line continue the unfinished content of the previous line
2. ## is used as a connection character. For example: 0x##11110000##L is replaced by 0x11110000. Convert 8 decimal numbers to hexadecimal. L represents a long integer of 32 bits.
3. flying a;
a=Bin(10101010);// a=0xaa
That is, bit operations can be implemented. Some compilers do not support direct binary operations, such as 0B10101010
Previous article:C51 implements calendar, temperature and alarm functions
Next article:51 MCU Buzzer Music Score Conversion Tool
- 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
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- CC26x2R LaunchPad Development Kit
- MOSFET Failure Causes
- I am a hardware engineer who has been working for more than 1 year. I want to ask the experts about charging outside of work.
- Video: Introduction to mmWave Sensors
- What should I do if MP1584EN often burns the chip?
- Ultrasonic water and gas meter design challenges and solutions
- Increase the frequency range of the RC voltage-controlled oscillator
- How do you guys choose whether to use a 4-layer board or a 2-layer board?
- Thank you for being there + thank you for your wife's protection
- The electrical engineer blew up the company because of a resignation dispute...