The CCS C Compiler's latest version supports a new function, scanf(). The scanf() function allows inputting a formatted string over the RS232 and parsing the received string into specified variables. For example the following will input the string "Name: CCS Time: 18430 Count: 58437" and store the received name in an array, the received time in an unsigned int32 variable and the received count in an unsigned int16 variable:
unsigned int32 time;
unsigned int16 count;
scanf(" Name: %s Time: %lu Count: %lu",name, &time, &count);
if(count > 0)
printf("rnCount %lu - Name: %s, Time: %lu",count, name, time);
Learn more about other compiler features and functions by visiting: http://www.ccsinfo.com/picc
Check out all the new devices supported and drivers in the latest compiler.
Like us on Facebook. Follow us on Twitter.
CCS is a leading worldwide supplier of embedded software development tools that enable companies to develop premium products based on Microchip PIC® MCU and dsPIC® DSC devices. Complete proven tool chains from CCS include a code optimizing C compiler, application specific hardware platforms and software development kits. CCS' products accelerate development of energy saving industrial automation, wireless and wired communication, automotive, medical device and consumer product applications. Established in 1992, CCS is a Microchip Premier 3rd Party Partner. For more information, please visit http://www.ccsinfo.com.
PIC® MCU, MPLAB® IDE, MPLAB® ICD2, MPLAB® ICD3 and dsPIC® are registered trademarks of Microchip Technology Inc. in the U.S. and other countries.