I am working on a project based on TCS34725 RGB color sensor. The main control I use is MSP430. When debugging, I use 485 bus to send to the upper computer (computer or upper host computer). At first, I used the serial port sending function to send directly, but it was super inconvenient to display a lot of data, such as floating point numbers and data streams with special formats. Previously, I used the serial port sending function to group a function by calling the int putchar (char *) function. So I spent a few minutes writing a putchar function, which has been used and really succeeded... Thinking about the stupid way of constructing formats one by one and converting numbers into strings before, now I can finally use the printf function...
int putchar(int ch) { if (ch == '\n') { RS485Send_Byte(0x0d) ; } RS485Send_Byte(ch); //Send data from the serial port return (ch); }
Previous article:IAR development environment uses serial printf output (based on STM8L15x series microcontroller)
Next article:iar for stm8 beginner summary
Recommended ReadingLatest update time:2024-11-24 21:35
- Popular Resources
- Popular amplifiers
- MSP430 series single chip microcomputer system engineering design and practice
- oled multi-chip calling program
- Microcontroller Principles and Applications Tutorial (2nd Edition) (Zhang Yuanliang)
- Getting Started and Improving MSP430 Microcontrollers - National Undergraduate Electronic Design Competition Training Course
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- CATL releases October battle report
- Battery industry in October 2024: growth momentum remains unabated!
- Mercedes-Benz will launch the eCitaro equipped with NMC4 batteries to provide high energy density and long life
- Many companies have announced progress on solid-state batteries. When will solid-state batteries go into mass production?
- Xsens Sirius Series Inertial Sensors Enable 3D Inertial Navigation in Harsh Environments
- Infineon's Automotive Landscape: From Hardware to Systems
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- Saddam and Bush's love song
- [Ateli Development Board AT32F421 Review] + Unboxing and Learning Plan
- What are risc-v chips?
- sensortile box source code
- Dedicated to college students majoring in electronics---a few thoughts reposted
- Lingdongwei MM32 download program error description solution
- Double 12 limited time offer | Tektronix year-end rewards, oscilloscope third-order upgrade!
- Driver chip in Type-c OTG mode - LDR6028S
- PowerHap piezo actuators with haptic feedback, new dimensions, new performance
- Multi-touch technology is widely used in the field of segment screens