开发者

how to concatenate the ADC output?

hey I need help to开发者_如何学Python write a programe in pic c compiler that can cocatenate S, at the start of ADC out put value(q is the out put i.e q = read_adc() ) and E at the end of ADC output so that i can feed that string to computer by serial port communication.I am using pic microcontroller 16f877A how to do that pls help me...thanx


Besides the question need more info and isnt detailed, I suppose you are coding in C. To concatenate a long int to a char you need to use itoa() which will take the int and return a char*, later you just need to do some string process to concatenate them.

Anyway, most of times this is not necessary, because if you need to output the adc value, let's suppose to your serial, you can just first output 'S', then the adc value, and then the 'E'.

Working with strings functions in microcontrollers most of times just causes to load a lot of unused code and lost space.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜